Easily update values with variables
Variables let you define a value (an address, for example) once, and use it multiple times throughout the action sequence. Set variables if certain values will change regularly, or if you are going to reuse the sequence in another TOPdesk that uses different values for certain fields.
Picture this: the URL to which you send the requests with your action sequence has just changed. You only want to change that URL once, and not for every occurrence in the action sequence. With variables you don’t have to search through the entire body of all the steps to update that value. Simply enter the variable in the body as a placeholder, and whenever the actual value changes, you only have to update the value in the variable settings.
Say you need to list a domain name several times in the steps. Create a variable for the domain name, and use this variable in the sequence steps. Each time the domain name changes, you only have to update it once in the variable settings. For every occurrence of the variable in this action sequence, the new domain name will now be entered.
When you export a sequence for use in a different TOPdesk (e.g. a test environment), you can choose not to export the values of the variables. After exporting, you enter the values of the other TOPdesk in the variables.
Remark
Generally, do not export variable values if the action sequences will be used in a different environment. Otherwise, you risk unexpected changes in your environment or misuse of information by others.
Variables are available for the URL, headers, and body. You can apply FreeMarker syntax, and the value can be empty. You cannot insert a variable inside a variable.
Variables can be reused in all steps of a sequence, but not in different sequences.
To add a variable to your action sequence:
In the Variables block, click
.Two fields, Name and Value, plus the possibility to insert fields, appear.
In the Name field, enter the text with which you will refer to the variable. This part will function as the placeholder within the action sequence.
In the Value field, fill the current value that TOPdesk should use wherever you have filled the variable’s name.
In the body of a step, click Insert value (Alt+V)
.In the pop-up menu, open the Variables tab.
Select the correct variable. Also notice the structure of the variable in the Preview.
Click Insert.
The variable is added to the action sequence step.
Warning
If you put a URL in a variable, always add ?no_esc (making ${_variables.variableName?no_esc}) to make sure the URL is used correctly.
Tip
If the value of the variable differs per card via which the action sequence is triggered, use Insert value (Alt+V) to let TOPdesk fill a value of that card in the variable.
Tip
In actions created via the Automated Actions overview, use a Variable Assignment to define the value of a variable within your action sequence instead.
Tip
A default variable for your TOPdesk's URL is available on the General tab of the Insert value
menu.