Google Sheets Connector

ZappySys Google Sheets Connector provide read / write capability inside your app (see list below), using these drag and drop , high performance connector you can perform many Google Sheets operations without any coding. You can use this connector to integrate Google Sheets data inside apps like SSIS, SQL Server or popular ETL Platforms / BI Tools/ Reporting Apps / Programming languages (i.e. Informatica, Power BI, SSRS, Excel, C#, JAVA, Python)

Download for SSIS Download for Other Apps Documentation

Click on your App below to get started with Google Sheets Integration

Choose your App / Scenario for which you like to integrate Google Sheets

Actions supported by Google Sheets Connector

Google Sheets Connector support following actions for REST API integration. If some actions are not listed below then you can easily edit Connector file and enhance out of the box functionality.
 Read Sheet Data
Read google spreadsheet data from desired tab / cell location (i.e. start/end range)    [Read more...]
Parameter Description
Range
 Clear Sheet Values
Clears values from a spreadsheet. The caller must specify the spreadsheet ID and range. Only values are cleared -- all other properties of the cell (such as formatting, data validation, etc..) are kept.    [Read more...]
Parameter Description
Range
 Delete Sheet Rows / Columns
Deletes rows / columns based on startIndex / endIndex range (Index is zero based). For example to delete First 5 rows specify startIndex=0 and endIndex=4    [Read more...]
Parameter Description
Range Type Specifies what would you like to delete (i.e. Rows or Columns)
Option Value
ROWS ROWS
COLUMNS COLUMNS
Range Start Index (starts from 0) Range Start Index (Zero based) for operation. For Column Operation translate Alpha value to zero based index. Example: Column D = Index 3. Column AA=26
Range End Index (starts from 0) Range End Index (Zero based) for operation. For Column Operation translate Alpha value to zero based index. Example: Column D = Index 3. Column AA=26
TabId Numeric ID of SpreadSheet Tab for which you like to delete rows/columns. For first tab its 0. You can find this ID from Sheet URL in browser. Get Number after edit#gid= (thats your Tab ID)
 Delete SpreadSheet Tab
Deletes specified tab from spreadsheet    [Read more...]
Parameter Description
TabId Numeric ID of SpreadSheet Tab for which you like to delete rows/columns. For first tab its 0. You can find this ID from Sheet URL in browser. Get Number after edit#gid= (thats your Tab ID)
 Create SpreadSheet Tab
Creates new tab for specified spreadsheet.    [Read more...]
Parameter Description
NewTabName Name for new Tab you like to add
InitialRowCount Initial row count for new sheet
InitialColumnCount Initial column count for new sheet
TabColorRedValue Tab Color - Red Value for RGB
TabColorGreenValue Tab Color - Green Value for RGB
TabColorBlueValue Tab Color - Blue Value for RGB
 Execute Command(s)
Perform various operations available in online editor such as copy, paste, format, merge. Add multiple JSON command by adding comma after first command (e.g. requests : [ {..cmd1..} , {..cmd2..}, {..cmd3..} ] ) Refer to example requests on help link.    [Read more...]
Parameter Description
Request Body
TabId Numeric ID of SpreadSheet Tab for which you like to delete rows/columns. For first tab its 0. You can find this ID from Sheet URL in browser. Get Number after edit#gid= (thats your Tab ID)
 Update Sheet Data (Overwrite Cells)
Update data to spreadsheet on desired tab / cell location (i.e. start/end range)    [Read more...]
Parameter Description
Range for Table Boundary (Including Header) Enter Range to detect Table column names and datatypes. Example: enter A1:C if you have table of 3 columns starting from Cell A1
Range for Data Cells Cell Range which needs to be update. Example: Enter A2 if you like to start update from cell A2
 Insert Sheet Data (Append at the end)
Append data to spreadsheet on desired tab. Data is appended after last non-empty row/cell location. You can supply cell offset to start scan to find non-empty cell.    [Read more...]
Parameter Description
Start Range This is the range in which next row location is detected based on first empty cell and row (Examples: A1, A1:GR, A1:GR200). This range is also used to detect metadata. Values are appended after the last row of the table.
 Get Sheet Properties / Tab information
Read read sheet properties (e.g. list of tabs on sheet and its properties)    [Read more...]
Parameter Description
SpreadSheetId
Option Value
Enter SpreadSheet Id
Example SpreadSheet Id 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
 Generic Request
This is generic endpoint. Use this endpoint when some actions are not implemented by connector. Just enter partial URL (Required), Body, Method, Header etc. Most parameters are optional except URL.    [Read more...]
Parameter Description
Url API URL goes here. You can enter full URL or Partial URL relative to Base URL. If it is full URL then domain name must be part of ServiceURL or part of TrustedDomains
Body Request Body content goes here
IsMultiPart Set this option if you want to upload file(s) (i.e. POST RAW file data) or send data using Multi-Part encoding method (i.e. Content-Type: multipart/form-data). Multi-Part request allows you to mix key/value and upload files in same request. On the other hand raw upload allows only single file upload (without any key/value) ==== Raw Upload (Content-Type: application/octet-stream) ===== To upload single file in raw mode check this option and specify full file path starting with @ sign in the Body (e.g. @c:\data\myfile.zip ) ==== Form-Data / Multipart Upload (Content-Type: multipart/form-data) ===== To treat your Request data as multi part fields you must specify key/value pairs separated by new lines into RequestData field (i.e. Body). Each key value pair is entered on new-line and key/value are separated using equal sign (=). Preceding and trailing spaces are ignored also blank lines are ignored. If field value has some any special character(s) then use escape sequence (e.g. For NewLine: \r\n, For Tab: \t, For at (@): \@). When value of any field starts with at sign (@) its automatically treated as File you want to upload. By default file content type is determined based on extension however you can supply content type manually for any field using this way [ YourFileFieldName.Content-Type=some-content-type ]. By default File Upload Field always includes Content-Type in the request (non file fields do not have content-type by default unless you supply manually). For some reason if you dont want to use Content-Type header in your request then supply blank Content-Type to exclude this header altogather [e.g. SomeFieldName.Content-Type= ]. In below example we have supplied Content-Type for file2 and SomeField1, all other fields are using default content-type. See below Example of uploading multiple files along with additional fields. If some API requires you to pass Content-Type: multipart/form-data rather than multipart/form-data then manually set Request Header => Content-Type: multipart/mixed (it must starts with multipart/ else will be ignored). file1=@c:\data\Myfile1.txt file2=@c:\data\Myfile2.json file2.Content-Type=application/json SomeField1=aaaaaaa SomeField1.Content-Type=text/plain SomeField2=12345 SomeFieldWithNewLineAndTab=This is line1\r\nThis is line2\r\nThis is \ttab \ttab \ttab SomeFieldStartingWithAtSign=\@MyTwitterHandle
Filter Enter filter to extract array from response. Example: $.rows[*] --OR-- $.customers[*].orders[*]. Check your response document and find out hierarchy you like to extract
Headers Headers for Request. To enter multiple headers use double pipe or new line after each {header-name}:{value} pair

Google Sheets Connector Examples (For ODBC PowerPack)

This page offers a collection of SQL examples designed for seamless integration with the ZappySys API ODBC Driver under ODBC Data Source (36/64) or ZappySys Data Gateway, enhancing your ability to connect and interact with Prebuilt Connectors effectively.

Query from default Spreadsheet    [Read more...]

Gets data from Tab name Sheet1 from SpreadSheet Id defined in the connection

SELECT * FROM [Sheet1]

Query from User defined Spreadsheet    [Read more...]

Gets data from Tab name 'Class Data' from user defined SpreadSheet Id

SELECT * FROM [Class Data] WITH(SpreadSheetId='1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms')

Query from custom cell range    [Read more...]

In this example we query Tab name 'Class Data' and we are reading Range 'A4:GR'.

SELECT * FROM [Class Data]
WITH(
	  Range='A4:GR'  --cell range you like to query
	, ArrayTransEnableCustomColumns='False' --do not treat first row in range as Column Names
	, SpreadSheetId='1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms'  --enter sheet id you like to query. Comment this if you like to use default ID defined in the connection
)

Query from custom cell range    [Read more...]

In this example we query Tab name 'Class Data' and we are reading Range 'A4:GR'.

UPDATE [Sheet1]
SET Col1='data-1', Col2=100, Col3='2020-01-31' --column names are ignored. Values are sent in the same order you supply and writtern to start cell specified by WriteRange
WITH(
	, WriteRange='G9' --start writing from here
	, SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU' --comment this to use default Sheet Id from connection setting
)

Update Multiple Rows in Sheet from CSV file    [Read more...]

In this example we query CSV file as Source (Using ZapyySys CSV ODBC Driver) and updating Google Sheet in BULK.

UPDATE [Sheet1]
SOURCE(
 'ODBC',  --driver type ODBC | MSSQL | OLEDB
 'Driver={ZappySys CSV Driver};', --connection string for driver
 'SELECT * FROM $ WITH (SRC=''c:\data.csv'') ' --sql query for source data
)
WITH(
  WriteRange='G9', SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU' --comment this to use default Sheet Id from connection setting 
)

Update Values Vertically (Column Mode)    [Read more...]

In this example we will write value as columns rather than row.

UPDATE [Sheet1]
SET Col1='Jan',Col2='Feb',Col3='Mar'
WITH(
  WriteRange='G9', 
  SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU', --comment this to use default Sheet Id from connection setting
  MajorDimension='COLUMNS' --write values vertical rather horizontal
)

Insert Data in Sheet1    [Read more...]

Insert row to tab name Sheet1 in SheetId defined in connection

INSERT INTO "Sheet1"("MyStringCol", "MyIntegerCol", "MyDateCol", "MyDecimalCol") VALUES('AAA',100,'2020-01-01',150.33)

Insert Multiple Rows in Sheet1 from CSV file    [Read more...]

In this example we query CSV file as Source (Using ZapyySys CSV ODBC Driver) and updating Google Sheet in BULK.

INSERT INTO [Sheet1]
SOURCE(
 'ODBC', --driver type ODBC | MSSQL | OLEDB
 'Driver={ZappySys CSV Driver};', --connection string for driver
 'SELECT * FROM $ WITH (SRC=''c:\temp\dump.txt'') ' --sql query for source data
)
WITH(
  Range='G9', SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU' --comment this to use default Sheet Id from connection setting 
)

Write Values Vertically (Column Mode)    [Read more...]

In this example we will write value as columns rather than row.

INSERT INTO [Sheet1](Col1,Col2,Col3) 
VALUES('Jan','Feb','Mar')
WITH(
  Range='G9', --starting cell to write data
  SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU', --comment this to use default Sheet Id from connection setting
  MajorDimension='COLUMNS' --write values vertical rather horizontal
)

Execute Action (i.e. Delete Rows / Columns)    [Read more...]

This example shows how to execute various commands for sheet (i.e. copy, paste, formatting, delete, merge etc). In this example we are executing delete comamnds (i.e. deleteDimension commands). Notice we called same command twice becuase we want to delete two ranges (index 10-20 and 50-60). You can execute any valid command available by Google Sheets API. Here are some good examples of formatting commands https://developers.google.com/sheets/api/samples/formatting

SELECT * FROM batch_update_request
WITH(
	  Body='{
  "requests": [
    {
      "deleteDimension": {
        "range": {
          "sheetId": 0,
          "dimension": "ROWS",
          "startIndex": 10,
          "endIndex": 20
        }
      }
    } ,
    
   {
      "deleteDimension": {
        "range": {
          "sheetId": 0,
          "dimension": "ROWS",
          "startIndex": 50,
          "endIndex": 60
        }
      }
    }
    
  ]
}'
	, TabId='0' -- tab internal id (use UI to get this). 0 means first tab. Or check URL in browser and see at the end of URL #gid=xxxxxxx where xxxxxx is your tab id
	, SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU' --comment this to use default Sheet Id from connection setting
)

Download for SSIS Download for Other Apps