Endpoint Insert Sheet Data (Append at the end)
Name
insert_sheet_data
Description
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. [API reference]
Related Tables
Parameters
| Parameter | Required | Options | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
Name:
Label: 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. |
YES | |||||||||
|
Name:
Label: TabName If you have multiple tabs on your spreadsheet then you can specify here. By default first tab is used if you do not enter. |
||||||||||
|
Name:
Label: valueRenderOption |
|
|||||||||
|
Name:
Label: valueInputOption |
|
|||||||||
|
Name:
Label: majorDimension |
|
|||||||||
|
Name:
Label: dateTimeRenderOption |
|
|||||||||
|
Name:
Label: SpreadSheetId Enter unique spreadsheet Id. To obtain sheet Id. Open spreadsheet in browser and check URL. You will example value like 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms that is your sheet id. |
|
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| spreadsheetId |
DT_WSTR
|
nvarchar(100)
|
100 | |
| tableRange |
DT_WSTR
|
nvarchar(255)
|
255 | |
| updatedRange |
DT_WSTR
|
nvarchar(255)
|
255 | |
| updatedRows |
DT_I4
|
int
|
||
| updatedColumns |
DT_I4
|
int
|
||
| updatedCells |
DT_I4
|
int
|
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Examples
SSIS
Use Google Sheets Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Destination
This Endpoint belongs to the [Dynamic Table] table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to insert sheet data:
| Required Parameters | |
|---|---|
| Start Range | Fill-in the parameter... |
| Optional Parameters | |
| ArrayTransformType | TransformColumnslessArray |
| ArrayTransEnableCustomColumns | True |
| ArrayTransCustomColumns | Col1,Col2,Col3 |
ODBC application
Use these SQL queries in your ODBC application data source:
Insert a row into a sheet
<p>Inserts a single row into the <code>My sheet</code> tab in the default spreadsheet. <code>Column1</code>โ<code>Column4</code> represent your actual sheet columns.</p>
INSERT INTO "My sheet"(Column1, Column2, Column3, Column4)
VALUES('AAA', 100, '2020-01-01', 150.33)
Insert multiple rows into a sheet from a CSV file
<p>Bulk inserts multiple rows into a sheet using CSV data as the source. Reads rows from a CSV file using an ODBC connection and writes them into the specified range in the sheet.</p>
INSERT INTO [My sheet]
SOURCE(
'ODBC',
'Driver={ZappySys CSV Driver};',
'SELECT * FROM $ WITH (SRC=''c:\data\orders.csv'')'
)
WITH(
Range='G9',
SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU'
)
Write values vertically (column mode)
<p>Writes inserted values vertically starting at a specific cell. Uses <code>MajorDimension='COLUMNS'</code> so each value in the row becomes a column of values.</p>
INSERT INTO [My sheet](Column1, Column2, Column3)
VALUES('Jan','Feb','Mar')
WITH(
Range='G9',
SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU',
MajorDimension='COLUMNS'
)
insert_sheet_data endpoint belongs to
[Dynamic Table]
, Sheets
table(s), and can therefore be used via those table(s).
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Insert a row into a sheet
<p>Inserts a single row into the <code>My sheet</code> tab in the default spreadsheet. <code>Column1</code>โ<code>Column4</code> represent your actual sheet columns.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO "My sheet"(Column1, Column2, Column3, Column4)
VALUES(''AAA'', 100, ''2020-01-01'', 150.33)';
EXEC (@MyQuery) AT [LS_TO_GOOGLE_SHEETS_IN_GATEWAY];
Insert multiple rows into a sheet from a CSV file
<p>Bulk inserts multiple rows into a sheet using CSV data as the source. Reads rows from a CSV file using an ODBC connection and writes them into the specified range in the sheet.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO [My sheet]
SOURCE(
''ODBC'',
''Driver={ZappySys CSV Driver};'',
''SELECT * FROM $ WITH (SRC=''''c:\data\orders.csv'''')''
)
WITH(
Range=''G9'',
SpreadSheetId=''1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU''
)';
EXEC (@MyQuery) AT [LS_TO_GOOGLE_SHEETS_IN_GATEWAY];
Write values vertically (column mode)
<p>Writes inserted values vertically starting at a specific cell. Uses <code>MajorDimension='COLUMNS'</code> so each value in the row becomes a column of values.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO [My sheet](Column1, Column2, Column3)
VALUES(''Jan'',''Feb'',''Mar'')
WITH(
Range=''G9'',
SpreadSheetId=''1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU'',
MajorDimension=''COLUMNS''
)';
EXEC (@MyQuery) AT [LS_TO_GOOGLE_SHEETS_IN_GATEWAY];
insert_sheet_data endpoint belongs to
[Dynamic Table]
, Sheets
table(s), and can therefore be used via those table(s).