Environment Variables - Remove
Declaration
<AMENVVARS ACTIVITY="delete" NAME="text" TYPE="text (options)" />
Description
Removes a machine, user or process level environment variable.
Practical usage
Normally used to get rid an existing environment variable that is no longer needed.
Parameters
Environment Variable
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Variable scope | Text | Yes | User |
|
The
scope or level in which the environment variable to remove belongs
to. The available options are:
|
Environment Variable | Text | Yes | (Empty) | NAME="TEMP" | The name of the environment variable to remove. |
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 demonstrates a number of activities related to environment variables. An Environment Variable - Set activity creates a new environment variable of type "User" named "AMTemp" along with the value of "Automate Training". A Variable - Create activity creates an Automate variable named "EnvironmentVarValue." An Environment Variable - Get activity populates the Automate variable with the value of the newly created environment variable. Thereafter, a Dialog - Message activity displays the value of the created environment variable. The final step deletes the environment variable with the use of the Environment Variables - Remove activity.
<AMENVVARS ACTIVITY="set" TYPE="USER" NAME="AMTemp" VALUE="Automate Training" />
<AMVARIABLE NAME="EnvironmentVarValue"></AMVARIABLE>
<AMENVVARS TYPE="USER" NAME="AMTemp" RESULTVARIABLE="EnvironmentVarValue" />
<AMSHOWDIALOG>The value of environment variable 'AMTemp' is '%EnvironmentVarValue%'.</AMSHOWDIALOG>
<AMENVVARS ACTIVITY="delete" TYPE="USER" NAME="AMTemp" />