Create Record
Create a new Record in a specified Table.
create_record(tableId: ID, body: SimpleRecord, options?: UpdateRecordOptions):
Promise<SimpleRecord | undefined>
Parameter Name | Type | Description |
---|---|---|
tableId | string | The Id of the Table to create the record in. |
Record | SimpleRecord | A record object. |
options | object | Record update options. |
SimpleRecord
A simplified representation of a SmartSuite record.
export interface SimpleRecord {
id: ID;
title: string;
[key: string]: any;
}
Update Record Options
Optional parameters for record creation.
interface RecordOptions {
skipValidation?: boolean;
}
Example Script - Create Record
<!--create_record(tableId: ID, body: SimpleRecord, options?: UpdateRecordOptions ): Promise<SimpleRecord | undefined>;-->
<script>
window.SmartSuite.create_record('67647d9b7a03fad7da12d9f2', {
id: null,
title: 'new title test',
status: { value: 'ready_for_review', updated_on: null },
}).then((res) => {
console.log('result =>>>', res);
});
</script>
Response
200 response
{
"title": "new title test",
"description": {
"data": {
"type": "doc",
"content": []
},
"html": "",
"preview": ""
},
"assigned_to": [],
"status": {
"value": "ready_for_review",
"updated_on": "2024-12-20T22:16:16.766850Z"
},
"due_date": {
"from_date": {
"date": null,
"include_time": false
},
"to_date": {
"date": null,
"include_time": false
},
"status_is_completed": false,
"status_updated_on": null
},
"priority": "",
"first_created": {
"on": "2024-12-20T22:16:16.635150Z",
"by": "63a1f65723aaf6bcb564b1f1"
},
"last_updated": {
"on": "2024-12-20T22:16:16.635234Z",
"by": "63a1f65723aaf6bcb564b1f1"
},
"followed_by": [],
"comments_count": null,
"autonumber": 8,
"sab60f5c5b": "",
"s048e67ec8": "",
"s8f119717f": [],
"se0df7d290": "6765ecb0e74da2e4072a0836",
"id": "6765ecb0e74da2e4072a0836",
"application_slug": "swp6a6sm",
"application_id": "67647d9b7a03fad7da12d9f2",
"ranking": {
"default": "aaaaaaeoiy"
},
"deleted_date": {
"date": null,
"include_time": false
},
"deleted_by": null
}