Variable - Return

Declaration

<AMVARIABLE ACTIVITY="return" TYPE="text (options)" VALUE="text" VARIABLE="text" />

Related Topics   

Description

Exits the current function and returns task execution to the calling function. A return value can also be specified to the caller.

Practical usage

Immediately ends execution of the current function and returns its argument as the value of the function call.

Parameters

General

Property Type Required Default Markup Description
Value Text No (Empty) VALUE="return value" If enabled, specifies a text return value. Enabling this parameter automatically disables the Contents of variable/dataset/array and Nothing parameters.
Contents of variable/dataset/array Text No (Empty) VARIABLE="varName" If enabled, denotes contents of the variable, dataset, or array as the return value. Enabling this parameter disables the Value and Nothing parameters.
Nothing Yes/No No Yes Null If enabled, specifies no contents as the return value. Enabling this parameter disables the Value and Contents of variable/dataset/array parameters. This parameter is enabled by default.

Description

Error Causes

On Error

Additional notes

Using variables

All variables must be created before they can be used. This is done using the Create variable activity. Once created, variables can be set using the Set variable activity, or by certain actions that support populating variables. To get data out of the variables in any action parameter, simply surround the variable name with percentage % signs (for example, %varname%). Remember not to use percentage signs when specifying the name of a variable to populate, percentage signs are only needed to get data out.

Example

NOTE:
  • 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

Return the value "This is the value to return." from the function.

Copy
<AMVARIABLE ACTIVITY="return" TYPE="value" VALUE="This is the value to return" />