If Last Step Action




See Also

If Last Step Action-Setting Properties, Else Action, End If Action, Loop Action, The BASIC Language All Groups


Controls task flow depending on whether the last step was a success, general failure, or failed because of a specific error. Causes the steps following this action to execute if the previous step meets the specified condition. If not, execution follows the next Else or End If action, whichever comes first.

Practical Usage

Used to provide custom error handling on steps that are set to ”r;continue on error”. This action introduces conditional steps depending on the outcome of the previous step. It is commonly used to introduce a block of steps to be carried out if the previous step fails.


General Tab

If Last Step

Text [options], Optional - Default "Succeeded"

Specifies the condition to be met.

Options are:

Error Codes

Text, Required if LASTSTEP="failedwithcode"
MARKUP: RESULTCODE="24007, 30098"

Specifies the error codes to match.


Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder


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

<AMIF LASTSTEP="failedwithcode" RESULTCODE="20074, 20089">