CreateSheet
Creates a new sheet in Smartsheet for data organization and tracking.
Procedure Specific Information
If the rules specified below are not followed, the procedure will fail with an error.When executing this stored procedure, exactly one of the following parameters must be specified:
- WorkspaceId: creates the sheet in the specified workspace.
- FolderId: creates the sheet in the specified folder.
The same restriction applies for the following group of parameters:
- TemplateId: creates the sheet from a template.
- ColumnsAggregate: creates the sheet using the column definitions specified in the JSON array.
ColumnsAggregate
The value provided for the ColumnsAggregate parameter must be a JSON array of column definition objects in the following format:[
{
"title": "Primary Column",
"type": "TEXT_NUMBER",
"primary": true,
"description": "The main identifier for each row.",
"validation": true
},
{
"title": "Status",
"type": "PICKLIST",
"symbol": "HARVEY_BALLS",
"options": ["Not Started", "In Progress", "Complete"]
},
{
"title": "Ticket Number",
"type": "TEXT_NUMBER",
"systemColumnType": "AUTO_NUMBER",
"autoNumberFormat": {
"prefix": "TKT-",
"fill": "00000",
"startingNumber": 1
}
},
// ...
]
In more detail:
- The array must contain at least one column definition object.
- For each column definition object, both the title and type fields must be specified.
- Only one column can be marked as primary, and it must be of type TEXT_NUMBER.
For the correct value format for this input parameter refer to Smartsheet's API Documentation.
Examples
For examples on how to use this stored procedure, refer to the following queries:-- Create a sheet in a workspace with basic columns
EXECUTE CreateSheet Name = 'Project Tracker', WorkspaceId = '7116448184199044', ColumnsAggregate = '[{"title":"Task Name","type":"TEXT_NUMBER","primary":true,"description":"The name of the task."},{"title":"Status","type":"PICKLIST","options":["Not Started","In Progress","Complete"],"validation":true}]';
-- Create a sheet in a folder with system columns, contact options, and auto-number
EXECUTE CreateSheet Name = 'Team Tasks', FolderId = '3791509922310020', ColumnsAggregate = '[{"title":"Task","type":"TEXT_NUMBER","primary":true},{"title":"Assignee","type":"CONTACT_LIST","contactOptions":[{"email":"[email protected]","name":"Jane Doe"}]},{"title":"Ticket","type":"TEXT_NUMBER","systemColumnType":"AUTO_NUMBER","autoNumberFormat":{"prefix":"TKT-","fill":"00000","startingNumber":1}},{"title":"Created","type":"DATETIME","systemColumnType":"CREATED_DATE"}]';
Input
| Name | Type | Required | Description |
| Name | String | True | The name of the new sheet to be created. This should be a unique, user-friendly identifier for the sheet. |
| WorkspaceId | String | False | The unique identifier of the workspace (root) in which the new sheet will be located. |
| FolderId | String | False | The unique identifier of the folder in which the new sheet will be located. |
| TemplateId | String | False | The unique identifier of the template to use for creating the new sheet. |
| ColumnsAggregate | String | False | A JSON array of column definition objects for the new sheet's columns. |
Result Set Columns
| Name | Type | Description |
| Success | Boolean | A boolean or status flag indicating if the sheet creation operation was successful. |
| Id | String | The unique identifier of the sheet created. |