Autorun AI Docs
Process DesignerUI FunctionUI Functions Reference

6. Event

The context.event object is injected at execution time and gives you access to what changed and what the record looked like before the change. It is most commonly used inside onUpdate triggers.


context.event.updates

sync · returns object

Contains the new values for any fields that were just changed. Only fields that were part of the triggering update are present. You can also write back to this object to set computed field values as part of the same update.

Prop

Type

if (context.event.updates.Price) {
  context.event.updates.TotalItemAmount =
    Number(context.event.updates.Price) * Number(context.event.innerValue.Quantity);
}

Writing to context.event.updates.FieldName is how you set a computed value on the record as part of the same save operation — the platform will persist the value you assign.


context.event.innerValue

sync · returns object

Contains the original values of all fields on the record before any updates were applied. Use this to read fields that were not part of the triggering change.

Prop

Type

if (context.event.updates.Quantity) {
  context.event.updates.TotalItemAmount =
    Number(context.event.innerValue.Price) * Number(context.event.updates.Quantity);
}
Pro Tip

Use context.event.updates for changed fields and context.event.innerValue for unchanged ones. Mixing them up is the most common source of undefined values in onUpdate functions.