Update Loop Data
The Update Loop Data action sets the values of a loop's fields and, optionally, its title. Values are checked against the field definitions of the loop's type. If a value is not valid, the action fails and changes nothing.
When to Use This Action
Use this action when:
- You want to record what a run learned, such as a reply status or an amount from an email
- You want to store a value that later stages or other workflows look up (indexed fields can be used to find the loop)
- You want to keep a counter or flag that a stage checks to decide where the loop goes next
To leave a human-readable remark instead, use Add Loop Note.
Configuration
| Field | Description |
|---|---|
| Loop | The ID of the loop. Optional in a loop stage or event: leave it empty to use the loop this run belongs to. Required everywhere else, including in a macro or AI action called from a loop run, because those do not see the calling loop. Supports text expressions. |
| Title | A new title for the loop. Leave empty to keep the current title; this action cannot clear a title. Supports text expressions. |
| Field Values | The fields to change. Fields you do not list keep their values. |
Field Values
Each row has a Field and a Value.
| Field | Description |
|---|---|
| Field | A field of the loop's type, or a global field the loop type uses. Choose it from the list, or unlock the field and type its name (the name used as loop.<name>, for example customer_email, not the display label; names are case-sensitive), its ID, or a text expression that renders one of them. An ID is tried first, then the name. |
| Value | The new value. Supports text expressions. Leave empty to clear the field. List fields take a JSON list such as ["a","b"]. Boolean fields take true or false, or 1 or 0. |
The list shows fields you have saved when you edit the actions of a stage or an event in a loop type. Fields you add while editing appear after you save the loop type. Everywhere else, Field is a text field: type the name, ID, or text expression. Choosing from the list stores the field's ID, so renaming the field later does not break the action.
Returned Variables
If you configure the Store the results in Variable option for this action, the variable holds the loop's data after the update, keyed by field name. Every field of the loop type is present, with an empty value where nothing is stored. For example, with the result variable updated, {{custom.updated.customer_email}} is the customer's email address.
When the action updates the loop that the run belongs to, loop also shows the new values, so the actions that follow in the same run see them. For example, {{loop.customer_email}}.
Notes
- The loop must belong to your account. An unknown loop ID fails the action.
- The action fails if a field name does not exist on the loop type, or if a value is not valid for its field (wrong type, not an allowed option, or too long for an indexed field). The message names the field.
- The action fails if you list the same field twice. Remove the duplicate row.
- If you leave Field Values and Title empty, the action changes nothing and still returns the loop's data.
- The action fails if the loop is closed. Reopen the loop first.