# Variables by Workato
Workato variable is a user-declared datapill that contains a data value. These user-declared variables are different from a standard datapill in that your declared variables are mutable - the value of the variable can be changed within a recipe.
The lifetime of a variable is for the duration of a single job (job scope) - there is no persistence, and no mechanism can access this across different jobs.
If you want to find a particular entry within a report - the entry with the largest ARR.
- Create a variable called
- Run the for each action, and update
ARRwhenever it finds a higher value.
- Subsequently, use the
ARRvalue to call up that specific entry.
Iterate through the report for highest ARR
# Connection setup
No connection setup is required. Simply select App > Variables by Workato to get started.
Variables by Workato
# Create variable action
This action creates a variable in the specified data type. You should configure this variable to match the data type that it will be used for (e.g.
|Variable name||The name of the variable.|
|Variable type||The data type of the variable.|
|Default value||The default value of the variable. Leave this blank to set the default value as |
# Update variable
This action updates an existing variable. You can only update variables previously created with the 'Create variable' action. Otherwise, this action cannot be used.
|Variable name||Select the variable to update.|
|Value||The new value of the variable.|
This action does not generate a datapill. To call your custom variable, use the output of the Create variable step.
# Reset the value of a variable
You can set a
nil value to variables in Update variable action to remove an existing value of a variable. This has to be done in the formula mode.
# Example: Creating a name variable from an image file
Suppose you want to read a name from an image file (e.g. PNG). You can generate a
Name variable and add the values for First name, Middle name, and Last Name.
Create a name variable from an image file
See the full example recipe here (opens new window).
# Create list action
This action creates an empty list with its item schema. The list item schema will apply to every item in the list.
|List name||The name of the list.|
|List item schema||Define the properties of each item on this list.|
# Define list item schema
The list item schema will show up as a list of usable variables in the output datatree. These variables can be mapped unto subsequent recipe steps. Use Add field to define a new field.
Add new field
|Name||The name of the new field.|
|Data type||The data type of the new field.|
|Optional||Select if this new field is mandatory.|
|Hint||A description of this new field.|
# Add item to list
This action appends a new item entry to an existing list. You can only update lists created with Variables by Workato.
Some item fields are mandatory. Check that you have valid inputs for the required fields before using this action.
Add item to list
|List name||Select the list to add your new entry.|
|Insert location||Select the location of the new entry.|
|List item||Define the values of the new entry.|
Note: This action does not generate a datapill. To call your list, use the output of the Create list step.
For more information on list management, see here.
# Clear all items from list
This action removes all entries in an existing list. This action should be used after a the 'Create list' and 'Add items to list' action. You can only clear lists created with Variables by Workato.
|List name||Select the list to clear all entries from.|