Environment Variables - Append
Declaration
<AMENVVARS ACTIVITY="append" NAME="text" VALUE="text" TYPE="text (options)" RESULTVARIABLE="text" />
Description
Appends text to a user, machine or process level environment variable and populates an existing Automate Desktop variable with the resulting value.
Practical usage
Mainly used to add or modify the value of an existing environment variable by appending text to the current value.
Parameters
Environment Variable
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Variable scope | Text | Yes | User |
|
The
scope or level belonging to the environment variable to append.
The available options are:
|
Environment variable | Text | Yes | (Empty) | NAME="TEMP" | The name of the environment variable to which the text will be appended. Click the down arrow to select from drop-down list of existing environment variables that correspond to the level specified under the Variable scope parameter. |
Text to append | Text | Yes | (Empty) | VALUE="new text" | The text to be appended to the value of the environment variable. |
Populate variable with value | Text | Yes | (Empty) | RESULTVARIABLE="VarName" | The name of an existing Automate Desktop variable in which to populate with the resulting value. |
Example
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
This sample task creates a variable named theVar and then appends the text "\subtemp" to environment variable "TEMP" of type "user." Then, a message box displays the value of the %theVar% (which is the value of the TEMP environment variable with the newly appended text).
<AMVARIABLE NAME="theVar"></AMVARIABLE>
<AMENVVARS ACTIVITY="append" TYPE="USER" NAME="TEMP" VALUE="\subtemp" RESULTVARIABLE="theVar" />
<AMSHOWDIALOG>%theVar%</AMSHOWDIALOG>