Technical Tip: FortiSOAR - Setting a global variable across different steps
Description
This article describes how to define a variable that should be set multiple times.
Scope
FortiSOAR.
Solution
Consider an example scenario where the user is trying to get a value of a variable in two steps, but needs to use this variable later.
The playbook steps are functions, and it is necessary to define a global variable to be used across both functions.
In the case above, it is necessary to define a variable that should be set twice: once during the 'Get Search Result' step, and once during the 'Get Email Details' step. It is then necessary to create a condition based on the variable changed in either of the set steps mentioned before.
What happens is that the final decision step is only considering one variable of the two.
To create a global variable:
Access the value of the variable in each of the Set Variable steps by using {{ vars.step.stepName.variableName }}. For example: for the 'Get Search Result' step, use {{ vars.steps. Get_Search_Result.variableName }}.
