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

FieldTypeRequiredDescriptionExample
Variable NameStringYesThe name of the variable to create or update (without {{}} brackets)userName, totalPrice, itemCount
ValueString/Number/FormulaYesThe 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

ExitWhenVariables Updated
PassAlways (stage cannot fail)✓ All variables created/updated in flow dictionary

How It Works

When executed, the stage:

  1. Processes Each Variable - Iterates through all variable name-value pairs
  2. Resolves Values - Evaluates formulas, resolves variable references, processes static values
  3. Updates Dictionary - Stores each variable in the flow dictionary (overwrites if exists)
  4. Makes Available - Variables immediately accessible in subsequent stages using {{variableName}}

Value Types

Value TypeExampleDescription
Static TextHello WorldLiteral string value
Number42, 3.14Numeric 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

FeatureBehavior
Overwrites ExistingSetting a variable that exists completely replaces the previous value
Empty StringsEmpty values NOT added to dictionary (variable unchanged or not created)
Multiple VariablesCan set any number of variables in a single stage
Sequential ProcessingVariables processed in order; later variables can reference earlier ones in same stage
Formula EvaluationFormulas starting with = are evaluated before storage
No Error ExitStage always succeeds (routes to Pass exit)

Do's and Don'ts

DoDon'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

IssueCommon CauseFix
Variable not accessible in later stagesVariable name includes {{}} bracketsRemove brackets from variable name field; they're added automatically when referencing
Value stored as literal text, not calculationFormula missing = prefixAlways start formulas with = sign: ={{price}} * {{quantity}}
Variable not created, shows as undefinedEmpty string value usedUse meaningful default like 0 for numbers, "" for text, or "N/A"
Formula evaluation errorCircular reference (variable references itself)Reference variable differently or split calculation across multiple stages
Formula returns empty resultUsing undefined variable in formulaEnsure all variables exist before using them; add Set Default Value stage first
Data loss in later stagesVariable name reused, overwriting previous valueUse unique names or intentionally design overwrites; Change Data always replaces values
Unexpected concatenation instead of additionMixed data types (string + number)Be consistent with data type selection; use DOUBLE_DATA for numeric calculations
Later variable can't reference earlier oneVariables processed out of orderVariables 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