If - Else
Declaration
<AMELSE />
Overview
Used along with any If activity to provide an alternate code block to execute only if the condition returns FALSE.
Practical usage
If combined with Else is an extremely useful combination. These activities are conditional statements that can perform different actions during the course of a task depending on the result of an expression evaluation. If the result evaluates to TRUE, the task executes the block of steps immediately following the If activity up until an End if step is encountered, otherwise the block is skipped (or if an Else statement is encountered it executes that block of steps).
Parameters
This activity contains no parameters.
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
The following Simple If / Else Statement displays the answer in a message.
<AMIF EXPRESSION="2 < 1" />
<AMSHOWDIALOG MESSAGE="The result is TRUE." />
<AMELSE />
<AMSHOWDIALOG MESSAGE="The result is False." />
<AMIF ACTIVITY="end" />