I'm rying to ENABLE THE GOOGLE SHEETS API on an existing projects.
I am following the instructions here: https://developers.google.com/sheets/api/quickstart/nodejs
But when I click the blue button, select existing project from dropdown and click NEXT, it gives me an error:
Also, there is an error in console:
cb=gapi.loaded_0:148 POST https://clientauthconfig.clients6.google.com/v1/brands?alt=json&key=key 400
Also, the error does not show up when instead of selecting an existing project, I create a new one.
Related
I'm using Google Sheets API v4 from Java Client. I'm trying to get format from Cell class. Everything goes fine.
TEXT ROTATION
I'm succeed in getting TextRotation element with Vertical property set but, angle property is never set, what ever I put on source Google Sheets document.
Whatever the angle value selected in Google Sheet App, angle property is never set.
I've tried to inspect returned JSON, to know if the issue is in Java Client.
But JSON REST API also never returns this property.
Current Result:
.
Expected Result:
Issue and workaround:
When I saw CellFormat of the official document, I thought that the value of textRotation can be retrieved by the fields of sheets(data(rowData(values(userEnteredFormat(textRotation))))) when the method of "spreadsheets.get" is used. But when I tested this, no values are returned. So I thought that this might be a bug. And, when I searched this at the Google issue tracker, I found https://issuetracker.google.com/issues/146274218. From this situation, in the current stage, it seems that the values of textRotation cannot be retrieved by the method of "spreadsheets.get" of Sheets API.
When you want to retrieve the value of textRotation using a script, as a current workaround, you can achieve it using the Web Apps created by Google Apps Script as a wrapper. In this answer, I would like to propose the workaround.
When this workaround is reflected to the flow for your situation, it becomes as follows.
Usage:
1. Create new project of Google Apps Script.
Sample script of Web Apps is a Google Apps Script. So please create a project of Google Apps Script.
If you want to directly create it, please access to https://script.new/. In this case, if you are not logged in Google, the log in screen is opened. So please log in to Google. By this, the script editor of Google Apps Script is opened.
2. Prepare Web Apps side. (server side)
Please copy and paste the following script (Google Apps Script) to the script editor. This script is for the Web Apps. This Web Apps is used as an API.
Server side: Google Apps Script
function doGet(e) {
const key = "sampleKey";
const id = e.parameter.spreadsheetId;
const sheetName = e.parameter.sheetName;
if (e.parameter.key != key || !id || !sheetName) {
return ContentService.createTextOutput(JSON.stringify({message: "Error."})).setMimeType(ContentService.MimeType.JSON);
}
const sheet = SpreadsheetApp.openById(id).getSheetByName(sheetName);
const textRotations = sheet.getDataRange().getTextRotations().map(r => r.map(c => ({angle: c.getDegrees(), vertical: c.isVertical()})));
return ContentService.createTextOutput(JSON.stringify(textRotations)).setMimeType(ContentService.MimeType.JSON);
}
3. Deploy Web Apps.
On the script editor, Open a dialog box by "Publish" -> "Deploy as web app".
Select "Me" for "Execute the app as:".
By this, the script is run as the owner.
Select "Anyone, even anonymous" for "Who has access to the app:".
Of course, you can use the access token for this situation. But in this case, as a simple setting, I use the access key instead of the access token.
Click "Deploy" button as new "Project version".
Automatically open a dialog box of "Authorization required".
Click "Review Permissions".
Select own account.
Click "Advanced" at "This app isn't verified".
Click "Go to ### project name ###(unsafe)"
Click "Allow" button.
Click "OK".
Copy the URL of Web Apps. It's like https://script.google.com/macros/s/###/exec.
When you modified the Google Apps Script, please redeploy as new version. By this, the modified script is reflected to Web Apps. Please be careful this.
3. Testing.
As a simple test, when it requests to the Web Apps using a curl command, it becomes as follows. Please set the spreadsheet ID and sheet name. When the Web Apps is correctly deployed, the values are returned.
$ curl -L "https://script.google.com/macros/s/###/exec?spreadsheetId=###&sheetName=Sheet1&key=sampleKey"
Result:
The data range is used for retrieving the values. So for example, when the values are set to the cells "A1:C3" in "Sheet1", the following result is returned.
[
[{"angle":30,"vertical":false},{"angle":0,"vertical":true},{"angle":0,"vertical":false}],
[{"angle":30,"vertical":false},{"angle":30,"vertical":false},{"angle":0,"vertical":false}]
]
In this case, the cells "A1, A2, B2" have the text rotation with 30 degree. And, the cell "B1" has the vertical direction.
Note:
When you modified the script of Web Apps, please redeploy the Web Apps as new version. By this, the latest script is reflected to Web Apps. Please be careful this.
References:
CellFormat
getTextRotations()
Web Apps
Taking advantage of Web Apps with Google Apps Script
Finally, I've written a JS Library : screen-rotation.js to manage all this stuff.
screenorientation().change(function(){
// My event management
});
It supports iOS, Android & desktop browsers
A Google Sheets data set is connected to Google Data Studio then explored in chart using data range.
For 1 or 2 days, data is visible in chart and we can also set range that period of time but after 2 days it shows the screen:
The data set is connected for some time or some days after this error occurs:
Data Set Configuration Error
Data Studio cannot connect to your data set. Failed to fetch data from the underlying data set.
I got the same issue, because I changed the owner of data source. I fixed it by changing the "data credentials".
This issue seems to be normally related to updates in underlying Spreadsheets data, for example, adding new columns. If that's the case, you can refresh the data source fields to get access to the data again. Also, check for changes in the file that might break the connection, like change of ownership.
In case this does not apply to your case, my suggestion is to go to the Data Studio Community site where you can check similar questions and even get responses by Data Studio team.
Looks like this issue may stem from the original source being a sheets file. I recently came across an issue where pointing to a view that is made off of a sheet tab was having this same exact problem.
We tried changing credentials, refreshing, etc and nothing worked. Turned out, you need to navigate to "Manage Data Sources" --> "Add Dataset" --> and select Google Sheets. You should be prompted to approve connection to Google Drive. Do this. Even if you are not literally pulling a sheet, do this. To be clear our workflow is as follows: team inputs information in sheets --> sheet is loaded in BQ --> create a view off of the table in BQ that is the sheet so we can manipulate as such --> point the dashboard to the view in BQ.
Upon doing so, refresh the connection and you should see data populate the table/chart.
In my case, it was the data source owner.
by changing the owner it works for me , because had a permission issue with the owner
Click on Data Credentials on the top menu.
Update Credentials Owner
I encountered this issue today(https://twitter.com/wey_gu/status/1385101021576372228), for the BigQuery data source being imported in data studio, for the reason the same data source can be imported properly by my project owner role account, it's suspected as permission caused issue.
By checking all predefined IAM roles related to BigQuery, it's found that the BigQuery Job User role is needed as the import action is underlying yet another BigQuery Job being triggerred.
Go to Edit Connection option in your Data Source. From here select the appropriate data sheet and click on RECONNECT OPTION. This is prompt if any issues identified in your excel and it will automatically fix the issue. Now you data set configuration error will be removed.
I would like to ask you for some advice: I developed a really simple Google Slides add-on that makes my life easier when I use slides. The problem is that the instructions seem to be so generic for diverse google products (apps, extensions, addons, etc) and I think I'm missing something.
I followed the instructions in the official docs. I created a script with the Scripts Editor and I choose to publish it as an addon. I completed the required fields and I was redirected to the Deveoper Dashboard, that does not let me upload the add-on with no manifest file. At this point, a manifest wasn't required by Google Slides, so I created one with no much idea and validating it with the error messages that the uploading tool throws. It is something like this:
{
"manifest_version": 2,
"name": "The name",
"version": "2",
"timeZone": "America/Argentina/Buenos_Aires",
"dependencies": {},
"exceptionLogging": "STACKDRIVER"
}
I was able to upload that manifest, but the package is listed as a Chrome extension and not as a Google Slides add-on (creating a new slide and accessing document > addons > download addons).
I spent 5 hours reading how to do it ok, but I could not achieve it and I'm really tired of guessing. Can anyone point me to a concrete documentation/tutorial/video in a concrete Google Slides scenario?
PS: if I try to update the add-on from the Script Editor, by publishing it again, it tells me "This item is not an app, please remove app section from manifest". But there is no manifest in the Script Editor, and there is no app field in the manifest uploaded in the Deveoper Dashboard. And by the way, publishing in the Deveoper Dashboard forces you to have a manifest...
Thanks, thanks, thanks in advance.
To create and publish Google Slides add-on, follow these steps:
Open https://drive.google.com.
Create new Google Apps Script project by selecting New - More - Google Apps Script.
Save project by selecting from Google Apps Script editor menu File - Save.
Popup window will ask you to enter your project's name, fill it and press OK.
Code your add-on functionality.
For publishing add-on, select from Google Apps Script editor menu Publish - Deploy as web add-on...
In opened modal, fill needed details (Add-on Type: Slides; Version: New; Post-install tip) and click Create web store draft.
https://chrome.google.com/webstore/developer/edit/ADDON_ID will open.
Scroll down the page and click Publish changes.
Your add-on is published!
I have tried the gmail action example provided here
But no button is coming up in inbox. I am following instructions and doing testing for my gmail account.
Any help will be appreciated
The quickstart sample is perfectly working. I've attached a screenshot as proof:
Check the steps indicated in Creating the project once again and be sure you have both the Code.gs and html file named mail_template. Also, make sure that the function testSchemas is selected in the Select function dropdown menu.
I have created a Google Home agent to control my thermostat. Of course I want to be the only one using and controling it. So I dont want to publish the app.
There is a small tutorial for extending the use of the simulator and even an update for V2. But the V2 update I can't seem te get to work, I get to following error:
Unable to parse action package: invalid character ',' after top-level
value
Did someone else get this to work?
This is the tutorial (scroll down for the update by #dadykhoff)
Make google actions development project preview persist longer