Reference

Endpoint Add Sheet Rows


Name

add_sheet_rows

Description

Add rows to a Sheet.

Related Tables

[Dynamic Table]

Parameters

Parameter Required Options
Name: RowLocation

Label: Add Row at Specific Location (Default=toBottom)

Option Value
"toBottom": true "toBottom": true
"toTop": true "toTop": true
"parentId": 1231234567 "parentId": 1231234567
"siblingId": 1231234567 "siblingId": 1231234567
Name: AllowPartialSuccess

Label: Allow Partial Success (Default=False)

When specified with a value of true, enables partial success for this bulk operation. See Partial Success for more information.
Option Value
false false
true true
Name: OverrideValidation

Label: Override Validation (Default=False)

You may use the query string parameter overrideValidation with a value of true to allow a cell value outside of the validation limits. You must specify strict with a value of false to bypass value type checking.
Option Value
false false
true true

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_I8 bigint
CreatedAt DT_DBTIMESTAMP datetime
ModifiedAt DT_DBTIMESTAMP datetime
CreatedAtLocalTime DT_DBTIMESTAMP datetime
ModifiedAtLocalTime DT_DBTIMESTAMP datetime
RowNumber DT_I4 int
BatchMessage DT_WSTR nvarchar(4000) 4000
BatchFailedItems DT_NTEXT nvarchar(MAX)
BatchResultCode DT_I4 int
Version DT_I4 int
HttpStatusCode DT_I4 int
PrevRowId DT_I8 bigint
If the column you are looking for is missing, consider customizing Smartsheet Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
[$parent.title$] DT_WSTR nvarchar(2000) 2000
==Checkbox Columns === DT_BOOL bit
Required columns that you need to supply are bolded.

Examples

SSIS

Use Smartsheet 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 add sheet rows:

API Destination - Smartsheet
Read and write Smartsheet data effortlessly. Integrate, manage, and automate sheets, rows, and reports — almost no coding required.
Smartsheet
[Dynamic Table]
Insert
Optional Parameters
Add Row at Specific Location (Default=toBottom) "toBottom": true
Allow Partial Success (Default=False)
Override Validation (Default=False)
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Create a sheet row

<p>Creates a new row in a sheet. You can specify values for various column types such as Text/Number, Checkbox, Contact List, Date, Picklist, and Symbol.</p>

INSERT INTO [My Sheet]
  ( [Some Text Number Column], [Some Checkbox Column], [Some Contact List Column], [Some Date Column], [Some PickList Column], [Some Multi PickList Column], [Some Symbol Column] )
VALUES 
  ('Updated at <<FUN_NOW>>', true, 'something@abc.com', '2024-12-31','Not Started','Value2,Value4','Green,Yellow')
/*
WITH(
RowLocation='"toTop": true'  --insert at the top
--OR--
--RowLocation='"siblingId": 1231234567'  --insert after some sibling row id
)			
*/

Bulk create sheet rows using SQL Server data

<p>Bulk creates rows in a sheet by reading data from an external SQL Server database using the <code>SOURCE</code> clause. Column names must match the target sheet's column names.</p>

INSERT INTO [My Sheet]
SOURCE(   'MSSQL'--OR 'ODBC'--OR 'OLEDB'
        , 'Data Source=localhost;Initial Catalog=tempdb;Integrated Security=true'
		--OR for ODBC
		--,'DSN=MyOdbcDsn'
		--OR (DSN less connection)
		--,'Driver={Some ODBC Driver};uid=xxx;pwd=xxx;prop1=xxx;prop2=xxx....'
        , 'SELECT ''2012-12-31'' [Some Date Column],''true'' [Some CheckBox Column],''Good example'' [Some Text Column]
           UNION 
		   SELECT ''2012-13-31'' [Some Date Column],''false'' [Some CheckBox Column],''Bad date example'' [Some Text Column]
           UNION 
		   SELECT ''2012-10-01'' [Some Date Column],''true'' [Some CheckBox Column],''Good example'' [Some Text Column]
        ')
--WITH(AllowPartialSuccess='true',output=1)

add_sheet_rows endpoint belongs to [Dynamic Table] 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:

Create a sheet row

<p>Creates a new row in a sheet. You can specify values for various column types such as Text/Number, Checkbox, Contact List, Date, Picklist, and Symbol.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO [My Sheet]
  ( [Some Text Number Column], [Some Checkbox Column], [Some Contact List Column], [Some Date Column], [Some PickList Column], [Some Multi PickList Column], [Some Symbol Column] )
VALUES 
  (''Updated at <<FUN_NOW>>'', true, ''something@abc.com'', ''2024-12-31'',''Not Started'',''Value2,Value4'',''Green,Yellow'')
/*
WITH(
RowLocation=''"toTop": true''  --insert at the top
--OR--
--RowLocation=''"siblingId": 1231234567''  --insert after some sibling row id
)			
*/';

EXEC (@MyQuery) AT [LS_TO_SMARTSHEET_IN_GATEWAY];

Bulk create sheet rows using SQL Server data

<p>Bulk creates rows in a sheet by reading data from an external SQL Server database using the <code>SOURCE</code> clause. Column names must match the target sheet's column names.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO [My Sheet]
SOURCE(   ''MSSQL''--OR ''ODBC''--OR ''OLEDB''
        , ''Data Source=localhost;Initial Catalog=tempdb;Integrated Security=true''
		--OR for ODBC
		--,''DSN=MyOdbcDsn''
		--OR (DSN less connection)
		--,''Driver={Some ODBC Driver};uid=xxx;pwd=xxx;prop1=xxx;prop2=xxx....''
        , ''SELECT ''''2012-12-31'''' [Some Date Column],''''true'''' [Some CheckBox Column],''''Good example'''' [Some Text Column]
           UNION 
		   SELECT ''''2012-13-31'''' [Some Date Column],''''false'''' [Some CheckBox Column],''''Bad date example'''' [Some Text Column]
           UNION 
		   SELECT ''''2012-10-01'''' [Some Date Column],''''true'''' [Some CheckBox Column],''''Good example'''' [Some Text Column]
        '')
--WITH(AllowPartialSuccess=''true'',output=1)';

EXEC (@MyQuery) AT [LS_TO_SMARTSHEET_IN_GATEWAY];

add_sheet_rows endpoint belongs to [Dynamic Table] table(s), and can therefore be used via those table(s).