Change Data
Overview
Change Date creates or updates variables in your flow by assigning values directly. This stage allows you to set one or more variables to specific values, making them available for use in subsequent stages.
* Example flow demonstrating how Change Data assigns a category to a deposit based on the defined criteria and makes the value available for use in the next stage.
Note: The variable names, values, criteria, and configuration used in this example are for demonstration purposes only.
Where to find it: Actions > Transformers in the stage library.
When to Use
- Create new variables with initial values
- Update existing variable values
- Set multiple variables in a single operation
- Assign calculated values using formulas
- Initialize flow state variables
- Store intermediate calculation results
- Transform data from one variable to another
- Prepare data for API requests or storage operations
Configuration
Fields Reference
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| Variable Name | String | Yes | The name of the variable to create or update (without {{}} brackets) | userName, totalPrice, itemCount |
| Value | String/Number/Formula | Yes | The data to assign (static text, number, variable reference, or formula starting with =) | Hello World, {{existingVar}}, ={{price}} * {{quantity}} |
CRITICAL: All variable references in the Value field must use {{variable}} syntax (double curly braces), NOT <variable> angle brackets.
Using functions in these fields: Any value field above accepts @ functions, for example @NowSecond for the current time or @calc(...) for a calculation.
See Flows Functions for the full list.
Exit Points
| Exit | When | Variables Updated |
|---|---|---|
| Pass | Always (stage cannot fail) | ✓ All variables created/updated in flow dictionary |
How It Works
When executed, the stage:
- Processes Each Variable - Iterates through all variable name-value pairs
- Resolves Values - Evaluates formulas, resolves variable references, processes static values
- Updates Dictionary - Stores each variable in the flow dictionary (overwrites if exists)
- Makes Available - Variables immediately accessible in subsequent stages using {{variableName}}
Value Types
| Value Type | Example | Description |
|---|---|---|
| Static Text | Hello World | Literal string value |
| Number | 42, 3.14 | Numeric value |
| Variable Reference | {{existingVariable}} | Copy value from another variable |
| Formula | ={{price}} * {{quantity}} | Calculation (must start with =) |
| Math function | =round({{price}} * 1.2) | Formula using math functions (round, floor, ceil, abs, sqrt, and similar) |
Formulas do math only. A value starting with = is calculated using arithmetic (+ - * /), exponentiation, and math functions (round, floor, ceil, abs, sqrt, log, and trigonometry). There is no IF or conditional logic in a Change Data value. use Route Flow for branching.
Common Use Cases
1. Initialize User Data
Set up user information variables at the start of a flow.
- Variable Name:
userName| Value:John Doe - Variable Name:
userEmail| Value:[email protected] - Variable Name:
userRole| Value:admin
2. Calculate Total Price
Compute total price using a formula.
- Variable Name:
totalPrice - Value:
={{unitPrice}} * {{quantity}} - Result: {{totalPrice}} contains calculated value
3. Transform Variable Data
Create a new variable from existing data.
- Variable Name:
fullName - Value:
{{firstName}} {{lastName}} - Variable Name:
displayText - Value:
Welcome, {{fullName}}!
4. Calculate a Duration in Minutes
Use a formula to turn a period into minutes (handy for time-to-live values used by other stages).
- Variable Name:
ttlMinutes - Value:
=60 * 24 * 30 - Result: {{ttlMinutes}} = 43200 (30 days in minutes)
Key Behaviors
| Feature | Behavior |
|---|---|
| Overwrites Existing | Setting a variable that exists completely replaces the previous value |
| Empty Strings | Empty values NOT added to dictionary (variable unchanged or not created) |
| Multiple Variables | Can set any number of variables in a single stage |
| Sequential Processing | Variables processed in order; later variables can reference earlier ones in same stage |
| Formula Evaluation | Formulas starting with = are evaluated before storage |
| No Error Exit | Stage always succeeds (routes to Pass exit) |
Do's and Don'ts
| Do | Don't |
|---|---|
| ✓ Use descriptive variable names (customerEmail, not email1) | ✗ Include {{}} brackets in variable name field |
| ✓ Use formulas for calculations (={{price}} * {{quantity}}) | ✗ Forget formula prefix (always start with =) |
| ✓ Set related variables together for organization | ✗ Use empty values for initialization |
| ✓ Initialize variables before use in conditional logic | ✗ Create circular references (variable referencing itself) |
| ✓ Use consistent naming conventions (camelCase or snake_case) | ✗ Use undefined variables in formulas |
| ✓ Leverage {{variable}} substitution to transform data | ✗ Accidentally overwrite important variables |
| ✓ Pre-calculate complex values here, use simple references elsewhere | ✗ Mix data types carelessly (STRING vs DOUBLE) |
| ✓ Remember later variables can reference earlier ones in same stage | ✗ Hardcode values that should be calculated |
Troubleshooting
| Issue | Common Cause | Fix |
|---|---|---|
| Variable not accessible in later stages | Variable name includes {{}} brackets | Remove brackets from variable name field; they're added automatically when referencing |
| Value stored as literal text, not calculation | Formula missing = prefix | Always start formulas with = sign: ={{price}} * {{quantity}} |
| Variable not created, shows as undefined | Empty string value used | Use meaningful default like 0 for numbers, "" for text, or "N/A" |
| Formula evaluation error | Circular reference (variable references itself) | Reference variable differently or split calculation across multiple stages |
| Formula returns empty result | Using undefined variable in formula | Ensure all variables exist before using them; add Set Default Value stage first |
| Data loss in later stages | Variable name reused, overwriting previous value | Use unique names or intentionally design overwrites; Change Data always replaces values |
| Unexpected concatenation instead of addition | Mixed data types (string + number) | Be consistent with data type selection; use DOUBLE_DATA for numeric calculations |
| Later variable can't reference earlier one | Variables processed out of order | Variables processed sequentially; ensure referenced variable appears earlier in same stage |
Edge Cases
Overwriting Existing Variables
Setting a variable that already exists completely replaces the previous value. No merging or appending occurs. Use this to update variable values mid-flow.
Empty String Values
Empty values are NOT added to the dictionary. Variable remains unchanged if it existed, or not created if it's new. For numbers, zero is a valid value and will be stored.
Variable Name Resolution
Variable names can contain embedded variables: {{prefix}}_userName where {{prefix}} resolves first. Resolved variable name is used as the dictionary key, allowing dynamic variable naming.
Order of Execution
Variables are processed in the order they appear. Later variables can reference earlier variables set in the same stage. Dictionary is updated sequentially.
Related Stages
- Set Default Value: Sets default values only if variable doesn't exist (different from Change Data which always overwrites)
- Save Data: Persists variables to storage for later retrieval or use across flows
- Fetch Data: Retrieves stored data and loads it into variables
- Call API: Often uses variables created by Change Data in request payloads
- Route Flow: Uses variables set by Change Data for conditional routing decisions
- Increment Number: Specialized stage for safely incrementing numeric counters