Environment Variables - Append

Declaration

<AMAPPENDENVIRONMENT NAME="text" TYPE="text(options)" VALUE="text" RESULTVARIABLE="text" />

See Also

Environment Variables - Append | Environment Variables - Delete | Environment Variables - Get | Environment Variables - List | Environment Variables - Set

Description

Appends text to a system or user-level environment variable. Optionally, this action can populate a variable with the resulting value.

IMPORTANT: Basic knowledge about Windows system and user level environment variables and their functionality are required in order to properly use these activities.

Practical Usage

Mainly used to change the value of an existing environment variable by appending text to the current value.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

Environment Variable Name

Text

Yes

(Empty)

NAME="TEMP"

The name of the environment variable to which the text will be appended.

Environment Variable Scope

Text

Yes

User

TYPE="USER"

The scope of the environment variable. The available options are:

  • User

  • Machine

  • Process

Text to append

Text

Yes

(Empty)

VALUE="new text"

The text to be appended to the value of the environment variable.

Populate variable with the value

Text

No

(Empty)

RESULTVARIABLE="VarName"

The name of an already created AutoMate variable in which to populate with the resulting value.

 

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: This sample creates a variable named "theVar". Next, it appends text "\subtemp" to environment variable "TEMP" of type "user". Finally, 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>

 

↑ [Top of Page]