Statement Scripts
Statement scripts declaratively describe actions on objects — creating new objects or updating existing ones. They are useful for automating workflows when an object is created or updated.
Definition
{
"name": "createWelcomeTask",
"type": "statement",
"scope": "OBJECT",
"trigger": "CREATE",
"parameters": [
{
"name": "title",
"value": "Send welcome email"
},
{
"name": "dueDate",
"formula": "dateAdd(creationDate, 3, 'day')"
}
]
}
Statement scripts express intent declaratively (create this object, set these fields) rather than imperatively. The platform translates the statement into the appropriate API calls.
Use cases
- Automatically create a related object when a dossier is opened
- Set a default status field when a record is created
- Copy fields from a parent object to a newly created child
Example: auto-create a task on dossier creation
{
"name": "createInitialReview",
"type": "statement",
"scope": "OBJECT",
"trigger": "CREATE",
"parameters": [
{
"name": "taskTitle",
"value": "Initial review"
},
{
"name": "dueDate",
"formula": "dateAdd(activeDate, 14, 'day')"
}
]
}
Parameters
Parameters work identically to other script types. Use formula to compute values from the current object, template for text interpolation, and value for literals.
See Scripts Overview for the full parameter reference.