Entity Change Tasks
Generic entity change task for modifying entity custom values, especially useful in "Before" triggers where you need to modify the entity before it's saved.
Entity/Change
Change entity custom values on the currently tracked entity in a Before trigger context.
task: "Entity/Change@1"
name: changeEntity
inputs:
changes:
customValues:
myField: "newValue"
calculatedField: "{{ computedValue }}"
Inputs
| Parameter | Type | Required | Description |
|---|---|---|---|
changes | object | Yes | Object containing the fields to change |
changes.customValues | object | No | Custom field values to set on the entity |
Use in Before Triggers
The Entity/Change@1 task is designed primarily for use in Before triggers, where the entity has not yet been persisted. This allows you to modify the entity's data before it's saved to the database.
triggers:
- type: "Entity"
entityName: "Order"
eventType: "Modified"
position: "Before"
activities:
- name: enrichOrder
steps:
- task: "Entity/Change@1"
name: setDefaults
inputs:
changes:
customValues:
lastModifiedBy: "{{ currentUser.name }}"
modifiedDate: "{{ now() }}"
region: "{{ parseAddress(Order.ShipToAddress).state }}"
warning
Async "Before" triggers are forbidden. All Before triggers must use executionMode: Sync.