Variable expression – reading an action variable¶
The variable expression reads the current value of a variable of the running action. It is how values are passed from one command of an action to the next – for example the answer to a prompt.
1. At a glance¶
| Purpose | Returns the current value of an action variable |
| Typical use | Using the answer of a prompt, a result of an earlier command or a loop counter in later commands |
| Returns | The value of the variable, with its type |
| Related | Prompt, Variables |
2. Settings¶
| Setting | Meaning |
|---|---|
| "Variable" | The variable of the action whose value is returned |
The type "Variable" is only offered where variables exist – in expressions written inside an action. In the quick reference list of a setting, the variables appear in the group "Variable".
3. Behaviour¶
- The expression returns the value the variable has at the moment of evaluation. A command that runs later can change it.
- If the variable has not been set yet, or the expression is evaluated outside an action, it returns an empty value.
- A stored expression has no action, so a variable expression only makes sense as a custom expression inside an action.
4. Example¶
An action asks for a reason with a Prompt and stores the answer in the variable
"Reason". A later command writes the text expression Closed: + variable "Reason" into the field
"Comment".