Skip to main content
Skip table of contents

if

The if command forms a basic conditional section. This command's child commands are evaluated only if the expression in the test attribute evaluates to a Boolean value of true.

Child commands

Any command can be a child of if. There should be at least one child, as a conditional section without content serves no purpose.

Attributes

test

Required

Value type

EL-evaluated

Yes

Boolean

Yes

Defines the conditional expression. Should the resolved value be a Boolean true, the child commands are evaluated, otherwise they are not.

Examples

To make use of if, place the commands you wish to make conditional as its children. Make sure that the EL expression for the test attribute evaluates into a Boolean value.

CODE
<if test="${mainOpportunity.IsClosed}">
        <set var="statusMessage" value="Opportunity is closed.">
        <next step="endScreen">

In many programming contexts an "if" statement is often accompanied by an "else" statement that executes when the "if" condition is not fulfilled. While there is no else command to do this, the if-else structure can be done by using the choose command with its when and otherwise child commands.  

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.