Environment Variables - Append

Declaration

<AMENVVARS ACTIVITY="append" NAME="text" VALUE="text" TYPE="text (options)" RESULTVARIABLE="text" />

Related Topics   

Description

Appends text to a user, machine or process level environment variable and populates an existing Automate variable with the resulting value.

NOTE: Any user can add, modify, or remove a user environment variable. However, only an administrator can add, modify, or remove a system environment variable.

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
  • TYPE="user"
  • TYPE="machine"
  • TYPE="process"
The scope or level belonging to the environment variable to append. The available options are:
  • User (default) - Append text to a user-level environment variable.
  • Machine - Append text to a machine-level environment variable.
  • Process - Append text to a process-level environment variable.
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 variable in which to populate with the resulting value.

Description

Error Causes

On Error

Example

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

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).

Copy
<AMVARIABLE NAME="theVar"></AMVARIABLE>
<AMENVVARS ACTIVITY="append" TYPE="USER" NAME="TEMP" VALUE="\subtemp" RESULTVARIABLE="theVar" />
<AMSHOWDIALOG>%theVar%</AMSHOWDIALOG>