Functionality - Variables
Using Variables
Summary
A variable created using save or set can be used in different ways.
You may want to:
-
Display its value to the Task Operator
-
Display the result of an expression that uses its value
-
Make a decision based on its value
Each use listed above is either elaborated on or linked to below.
Displaying Values
Simple Formatting
- Wrap a variable name in {{ }} to display its value inside some text
Simple Formatting
1 2 3 4 5 6 7 8 9 10 11 |
|
Expression Formatting
Use Jinja2 expressions to display different text based on a variable's value.
This example displays yes or no depending on the value of the boolean variable choice
.
Read more about Jinja2 expressions in the jinja documentation.
Expression Formatting
1 2 3 4 5 6 7 8 9 |
|
Supplying to Actions
Use load to supply variables as action parameters.
This example supplies the group_memberships
variable as the group_list action parameter.
Loading a Group List
1 2 3 4 |
|
Making Decisions
See the conditionals page for information & examples.