Create and adjust variables with Variable Assignment steps
Note
This feature is currently only available in action sequences.
Within action sequences, you can set the values for variables to be used in that action sequence. These already enable you to set one value and reuse it, which makes it easy to reuse action sequences or change a value that is used multiple times.
Note
For more information about variables, see Variables.
With the Variable Assignment step, you get the possibility to:
Create a new variable that takes data from earlier action sequence steps when defining the value that it should represent. Do so by entering a name in the Variable name field that is not yet used for a regular variable.
Update the value of an existing variable at any point within the action sequence. Do so by entering the name of the regular variable in the Variable name field of the Variable Assignment step.
Create files to include values in dynamically generated email attachments. The File name field allows you to specify both the name and the file extension.
This makes the Variable Assignment step useful for setting up more advanced action sequences.
To add a Variable Assignment step to your action sequence, click Add a Variable Assignment step while composing your action sequence.
![]() |
A new Variable Assignment has been added to your action sequence. The image below shows such a step, with in this example it name set to LoopResults.
![]() |
Features in Variable Assignment steps
Variable Assignment steps contain various fields, specific for this step, that help you to assign the right value to the right variable.
Variable name: Used to give your variable a name to which you can refer in later steps. When the name of an already existing variable is filled, the Variable Assignment step is used to update the value of that variable.
Type of variable: Offers you three types of variables:
Text: Values set with this type will always fully replace the existing value that was assigned to this variable.
List: New values assigned to this variable are added after the existing value(s) of this variable. For example, another value is added to a list that was assigned to this variable.
Attachment: Use values to automatically generate the content of a file that can be processed by an HTTP step or sent as an email attachment.
File name: (only visible if you select Attachment as the variable type)
Enter the desired file name and file extension.
Value: Used to define the value of the variable.
Log new value: Checkbox to determine whether the value is logged in the execution logs.
Note
Just like regular variables, the variables that are created and assigned via a Variable Assignment step can only be used within the action sequence in which that Variable Assignment step was added.
Examples
The Variable Assignment can be useful in plenty of applications. Some examples are:
Overwrite a variable that is already defined in the Variables block.
Assign response data from earlier steps to a variable.
Use the List variable type to make a list of data that was gathered with a repeating step.
Reuse extensive FreeMarker code by storing it within a Variable Assignment step. This way, you do not need to repeat extensive code multiple times within one action sequence.
Variable assignment with Attachment:
In the email step, you can select the attachment(s) you want to send from an automatically generated list.
In HTTP steps, you can attach files from previous Assign Variable steps.
In the Request body type field, select File from previous Assign Variable step.
Optionally, select Multipart request body (multipart/form-data) to add multiple Parts, allowing you to use variables defined in multiple files.
In the Body section, select the file defined in the variable.
note
TOPdesk automatically sets the header Content-Type to
application/octet-stream.

