The Variable by UnifyApps node lets you create runtime variables within an automation to store and reuse data in further nodes.
Overview
Run variables exist only during a single execution and can be updated as the run progresses. Session variables, covered below, hold values shared across a session.
Supported data types: String, Integer, Number, Boolean, Date, Date Time, Object, Array, Single Select Dropdown, Multi Select Dropdown.
Actions Supported
Action | Description |
|---|---|
Create Variables | Create typed variables |
Create List | Create a list and specify the schema for list items |
Update Variables | Update the value of existing variables |
Add Item to List | Adds a new item to an existing list |
Add Items to List | Adds multiple items to an existing list |
Modify Item at Index | Updates or removes an item in a list at a given index |
Find and Update Variable | Updates the value of a variable after locating it with the name provided |
Remove All Items from List | Removes all entries in an existing list |
Create 2D Variable | Creates a 2D variable |
Get 2D Variable | Gets the value at a specific (row, column) position from a 2D variable |
Update 2D Variable | Updates the value at a specific (row, column) position in a 2D variable |
Create 3D Variable | Creates a 3D variable |
Get 3D Variable | Gets the value at a specific (depth, row, column) position from a 3D variable |
Update 3D Variable | Updates the value at a specific (depth, row, column) position in a 3D variable |
Set Session Variables | Sets a value in a session variable |
Get Session Variables | Gets the values of variables shared across the session |
Clear Session Variables | Clears one or more variables from the session |
Use Cases
A practical example involves bucketizing Zendesk tickets by priority and notifying via Slack about high and low priority tickets. This involves:
Creating a variable list ticketStatus to store ticket IDs based on priority.
Running a "For each item in the list" action to check priority.
Adding items to the list where priority equals "High."
Create Variables
This action creates variables to transiently store and re-use information within an automation run.
Input Fields:
Key — Unique ID for the variable. It must start with a letter and can contain letters, numbers, hyphens and underscores.
Display Label — Name of the variable
Field type — Data type of the variable (with Array type and Options where the type needs them)
Default value — The value the variable starts with
Is Optional — Marks the variable as optional
Exclude field in runs — Omits sensitive information from run logs
Help Text, Nest under and Description — Extra details for the variable
Use "Add field" to create multiple variables, or click the bin icon / "Clear All" to delete variables.
Create List
This action creates a list to store multiple data points in a specific format. The list schema must be defined to map data in subsequent nodes.
Input Fields: List Schema; List Type (Object (default), String, Number, Integer, Boolean); Initial list items (the values the list starts with, empty by default); Setup using JSON.
When you have a predefined JSON Schema, select "Setup using JSON" to enter it directly. The schema is appended within the List's output data pill.
Update Variables
This action updates existing variables created with "Create Variables." Variables must already exist before this action can be used.
Input Fields: Select variable(s) to update; new value for each selected variable.
Note: This action outputs Result, Failed Variables and Updated Variables. To read a variable's new value, use the variable data pill from the Create Variables node.
Add Item to List
Inserts a new record into an existing list. Input Fields: List name; Insert location (Beginning of the list or End of the list); List item fields (values for the new entry); Capture added item (includes the added item in the step output).
Note: This action outputs success and, when Capture added item is on, the added item. Read the list itself from the Create List data pill.
Add Items to List
Adds multiple records to an existing list simultaneously. Input Fields: List name; Insert location; List item source (source array for data mapping); List item fields.
Note: This action outputs success and, when Capture added items is on, the added items. Read the list itself from the Create List data pill.
Find and Update Variable
Updates a variable after locating it by name. If more than one variable matches, the first one found is updated. Input Fields: Variable name (the Key used in Create Variables); Value (the new value).
Note: This action outputs Result. Read the variable's new value from the Create Variables data pill.
Remove All Items from List
Removes all items from an existing list. Should be used after Create List. Input Fields: List Name (name of the list to clear).
Modify Item at Index
Updates or removes a single item in a list. Input Fields: List name; Operation (Update item at index or Remove item at index); Index (zero-based position of the item); List item fields (the new values, for Update item at index). Output: success.
2D and 3D Variables
Create 2D Variable and Create 3D Variable create grid-shaped variables of String, Number, Integer or Boolean values. Use Get 2D Variable and Update 2D Variable with a Row Index and Column Index, and Get 3D Variable and Update 3D Variable with a depth, row and column position, to read or set a single value.
Session Variables
Session variables hold values shared across a session rather than a single run.
Set Session Variables — Sets a value in a session variable. Enter the Name and Field type of each variable.
Get Session Variables — Gets the values of the session variables you define.
Clear Session Variables — Clears one or more session variables. Enter the Variable Keys; use dot notation (for example, user.email) to clear nested variables. Outputs the cleared keys, the cleared count and any keys that were not found.
Notes
Keep the following in mind when using Variable by UnifyApps:
Variables you create with Create Variables, Create List or the 2D and 3D variable actions persist only for the duration of the current run; they reset on each new execution. To share values across a session, use the session variable actions.
Initialize all variables at the start of the automation before any branching logic reads them; reading an uninitialized variable returns null.
Use Create List and Add Item to List to build result collections inside a loop, then reference the completed list after the loop ends.
Find and Update Variable needs an exact match on the variable name (the Key from Create Variables). If no variable matches, nothing is updated and Result is false, so check spelling and casing.