LassoScript Utility
Basics Browse Detail

[If] ... [/If]

Tag Link [If] ... Category Conditional
Type Container Source Available No
Support Preferred Version 2.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation Internal Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 3.x, Lasso 2.5, Lasso 2.0, Lasso 1.x

Description

[If] ... [/If] executes the contents of the container only if the expression in the [If] tag returns True.

The [Else] tag can be used to check additional conditional expressions if the conditional expression in the [If] tag returns False. See the [Else] tag for more details.

Syntax

[IfConditional Expression]
  ...
[/If]

Parameters

Optional Parameters
Conditional Expression The conditional expression which is executed to determine if the contents of the container tag should be executed.

Examples

To show a field label only if the field contains a value:

Use the [If] tag with a conditional expression that checks whether the value for the field 'First_Name' is different from the empty string. The field label will only be shown if the field contains some data.

[If: (Field: 'First_Name') != ' ']
  <br>First Name: [Field: 'First_Name']
[/If]

<br>First Name: John