Update Field Value

This trigger updates the value of a field in the current record or a related record using a formula. To use this trigger, select:

  • A record to update: current or related record(s).
  • A field to change (depends on the previous selection).
  • A formula to calculate the new field's value: See below for expected return types.

Example 1: Update text field with value depending on numeric field:

({!amount} > 1000) ? "Big Order" : "Small Order");

Example 2: Update lookup field with multiple values (use JSON array):

 [ 12345, 56789 ]
Note: If this formula evaluates to or returns null, the field's value will not be changed.

In addition, the following options are available when configuring the trigger:

  • Access Control Policy — Most trigger types do not check permissions; however, the Update Field Value trigger (along with the Change Workflow Status and Create New Record trigger types) does check update and create permissions for the current user. When configuring a trigger of this type you can choose what Platform should do when access is not allowed:
    • Do Nothing: (ignore permissions)
    • Skip This Trigger: Do not run the trigger
    • Throw Error: This will terminate entire update or create transaction
  • Dependent triggers — Most triggers do not result in running other triggers; however, the Update Field Value trigger (along with the Change Workflow Status and Create New Record trigger types) does have the option to run dependent triggers after this one is completed by selecting the Run dependent triggers after this one is completed check box.
Note: If you use this option, Infinite Blue highly recommends using the trigger debugger to ensure expected results. See Debugging complex triggers for information about the trigger debugger.

The formula used in this trigger must return a value that is used to update the selected field on the current or related record(s). The expected return value depends on the type of the field to be updated as shown in the table below:

 

Field Type Expected Value
Text fields String
Numeric fields Number
Checkbox true or false
Process Process ID
Status Status ID or integration code
Single picklist Picklist item ID or integration code
Multiple picklist Picklist item ID as number or comma-separated string, with the picklist item's IDs
Lookup Related record ID as number, JSON array of IDs, or comma-separated string with related records IDs
Template Select Template ID or integration code
Date or Date/Time JavaScript Date object or number of milliseconds as returned by the JavaScript getTime() function
Time String representing time in user selected format. Example: 2:05 pm