The Advanced Sheets service lets you access the Sheets API using Apps Script. Much like Apps Script's built-in Google Sheets API service, this API allows scripts to read, edit, format and present data in Google Sheets. In most cases, the built-in service is easier to use, but this advanced service provides a few extra features.
Reference
For detailed information on this service, see the reference documentation for the Sheets API. Like all advanced services in Apps Script, the advanced Sheets service uses the same objects, methods, and parameters as the public API. For more information, see How method signatures are determined.
To report issues and find other support, see the Sheets support guide.
Sample code
The sample code below uses version 4 of the API; this is the only version of the Sheets API currently available as an advanced service in Apps Script.
Read values from a range
The following example demonstrates how to read data values from a specified range in a sheet with the Sheets advanced service. It is equivalent to the Read a single range recipe sample.
Write values to multiple ranges
The following example demonstrates how to write data to different, disjoint ranges in a sheet with one request. It is equivalent to the Write to multiple ranges recipe sample.
Add a new sheet
The following example demonstrates how to create a new sheet with specific size and tab color. It is equivalent to the Add a sheet recipe sample.
Create a pivot table
The following example demonstrates how to create a pivot table from source data. It is equivalent to the Add a pivot table recipe sample.