Can we create multiple sheets using Google Sheet API the way we create manually? - google-sheets-api

I want to add multiple sheets with different values under a google sheet but I cannot find it anywhere. Is it possible?

Your question is quite unclear. In case you're looking for a python way of adding new sheets, then you can refer to google sheets API documentation to Add sheets. You may use the Batch Update and Add Sheet request
{
"requests": [
{
"addSheet": {
"properties": {
"title": <<Your Sheet Name Goes Here>>,
"gridProperties": {
"rowCount": 20,
"columnCount": 12
},
"tabColor": {
"red": 1.0,
"green": 0.3,
"blue": 0.4
}
}
}
}
]
}

Related

How to update the pop-up note via API

I'm trying to update the pop-up note via the API. I can easily update the top box (aka the Note) but I don't see how I go about updating the pop-up section. What's odd to me is that the Note doesn't even appear in the WSE, abut when I send the update it does work.
When I retrieve the record, it also doesn't appear to send the data that I have in the pop-up section, and I'm not even clear how I can add it to the WSE.
I've tried just adding it to the JSON update with a couple different names like this (tried popupnote, notepopup), and that still goes through, but only updates the top box:
"note": {
"value": "Travis Update Test!"
},
"notepopup": {
"value": "Travis Pop update Test!"
},
Anyone know if this is possible?
The answer from Acumatica Support is below. In short you need to add a custom field in the items sectionm for the 2 notes and it works perfectly. When loading the items, if you plan to serialize into this class, add this ?$custom=Item.NoteText,Item.NotePopupText to the end of your url:
{
"id": "2a113b2c-d87f-e411-beca-00b56d0561c2",
"custom": {
"Item": {
"NoteText": {
"type": "CustomStringField",
"value": "Regular note 2"
},
"NotePopupText": {
"type": "CustomStringField",
"value": "Popup note 2"
}
}
}
}

Google Sheets API Chart - change a given datapoint fillcolor

In Google Sheets API, when using a chart shape, how can I colour a given datapoint a custom RGB? In the image below I have changed the color of 3 random datapoints. Is this possible?
It is possible to change the color and use a custom RGB color. If you already have the chart created, all you need to do is to use the batchUpdate method, and when creating the request include updateChartSpecRequest, then you'll need to select the type of chart that you are updating. In your case, based on the screenshot it would be basicChart, then from the chart, you want to update the series since those are the ones that generate the columns, and you can modify the color parameter there according to the official documentation.
Depending on what you want to end up doing, the structure of the request may end up being similar to this:
Request:
'request' : [
{
"updateChartSpec": {
"chartId": integer,
"spec": {
"basicChart": {
"series": [
{
"color": {
{
"red": number,
"green": number,
"blue": number,
"alpha": number
}
},
}
]
},
}
},
}
]
Note:
If you want to do it upon creation, instead of using updateChartSpec you would want to use addChart.
References:
updateChartSpecRequest
Color
BasicChartSeries
BasicChartSpec
addChart

Remove auto-link formatting from Google Sheet via api

When using Google Sheets Api to create automated reports I've found that any string that ends with ".com" automatically gets formatted as a link (I've attached a picture). I'd like to remove this formatting via the api, Is this possible?
Two examples of the autolink formatting
You can change the hyperlink format to the plain text format using "hyperlinkDisplayType". The endpoint and request body are as follows. As a sample, the request body removes the hyperlink format of cells "A1:A3". I thought that from the image of your question, repeatCell might be suitable for your situation.
Endpoint :
POST https://sheets.googleapis.com/v4/spreadsheets/### spreadsheet ID ###:batchUpdate
Request body :
{
"requests":
[
{
"repeatCell":
{
"cell":
{
"userEnteredFormat":
{
"hyperlinkDisplayType": "PLAIN_TEXT"
}
},
"fields": "userEnteredFormat.hyperlinkDisplayType",
"range":
{
"sheetId": sheetId,
"startRowIndex": 0,
"endRowIndex": 3,
"startColumnIndex": 0,
"endColumnIndex": 1
}
}
}
]
}
Note :
This answer supposes that you can use Sheets API.
Reference :
HyperlinkDisplayType
RepeatCellRequest
If I misunderstand your question, I'm sorry.

How to apply filters in Googlesheet API using Java

I have an API built along with Google Sheet API which interact with my google sheet and returns all the data. Is there a possible way to apply filter in google sheet and get only the data available to the filter(As like how we do filter in google sheet manually)?
You may check the following:
DataFilter that describes what data should be selected or returned from a request.
{
// Union field filter can be only one of the following:
"developerMetadataLookup": {
object(DeveloperMetadataLookup)
},
"a1Range": string,
"gridRange": {
object(GridRange)
},
// End of list of possible types for union field filter.
}
FilterCriteria for showing/hiding rows in a filter or filter view.
{
"hiddenValues": [
string
],
"condition": {
object(BooleanCondition)
},
}
PivotFilterCriteria for showing/hiding rows in a pivot table.
{
"visibleValues": [
string
],
}
Hope this helps!

Datatables 1.10 bSelectedOnly equivalent

I'm trying to find the equivalent of bSelectedOnly in the new version of Datatables 1.10.
I only want to print rows that the user has selected, or print all rows if they havn't selected any.
"tableTools": {
"sSwfPath": "/Datatables-1.10.0/extensions/TableTools/swf/copy_csv_xls.swf", //Add buttons for saving table data in these formats
"sRowSelect": "os", //allow user to select multiple rows in the table
"aButtons": [
{
"sExtends": "print",
"bSelectedOnly": "true",
},
{
"sExtends": "select_none",
},
]
},
It hasn't changed (see docs). But you have an error in your code. Instead of
"bSelectedOnly": "true",
it should be
"bSelectedOnly": true,
Also, bSelectedOnly is not available as a print option. It is only available as a flash button option. See here. That is the actual reason why what you're trying to do will not work :)