Skip to main content

Add Record Comment

Add a comment to a record.

Add Comment

Get a Record's comments from a specified Table and Record Id.

add_comment(comment: CommentForm): Promise<Comment>;
Parameter NameTypeDescription
CommentFormCommentForm objectA CommentForm object with new comment details.

CommentForm

export interface CommentForm {
application: ID;
record: ID;
message: CommentMessage;
parent_comment?: ID | null;
assigned_to?: ID | null;
resolved_by?: ID | null;
reaction?: string | null;
}

CommentMessage

The comment message can either be a SmartDoc object or HTML. Include only one or the other in your request.

export interface CommentMessage {
data: Doc; // SmartDoc Object
html: string; // HTML Body Content for Comment
}
Example Script - Create Comment

<!-- add_comment(comment: CommentForm): Promise<Comment>;-->
<script>

window.SmartSuite.add_comment({
application: "675adf9bb73844be508989b8",
record: "675c33aae97535a889b7727d",
message: {
"data": {
"type": "doc",
"content": [
{
"type": "paragraph",
"attrs": {
"textAlign": "left",
"size": "medium"
},
"content": [
{
"type": "text",
"text": "new comment 55"
}
]
}
]
},
"html": ""
}
}).then((respense) => {
console.log('result =>>>', respense);
});

</script>