Skip to main content

Introduction to Conditional Tags (If, Else, EndIf)

What Are If Tags?

If Tags let you conditionally show or hide content in your generated output. An If Tag evaluates a condition — and if that condition is true, everything between the If Tag and its corresponding EndIf Tag is included in the output. If the condition is false, that content is skipped entirely.

This is the same concept as an if statement in programming: if this is true, do this; otherwise, skip it.

The Three Tags

Conditional logic in Fluent Designer uses up to three tags:

  • If Tag — Defines the condition to evaluate. This is always required.
  • Else Tag (optional) — Defines alternative content to display when the If condition is false.
  • EndIf Tag — Marks the end of the conditional block. Every If Tag must have a corresponding EndIf Tag.

How It Works

The If Tag's query contains a condition — a Boolean expression that evaluates to true or false. The condition can reference data from your data source, variables from Set Tags or Retrieve Data Tags, or loop variables from ForEach/Repeat Tags.

If the condition is true: The content between the If Tag and the Else Tag (or EndIf Tag if there's no Else) is included in the output.

If the condition is false: That content is skipped. If an Else Tag is present, the content between the Else Tag and the EndIf Tag is included instead.

Common Use Cases

  • Showing data only when it exists — Display a phone number field only if the customer has one on file.
  • Conditional formatting — Show "Paid" in green when an invoice is settled, or "Overdue" in red when it isn't.
  • Role-based content — Include a manager summary section only for employees with a "Manager" title.
  • Region-specific content — Display a city name only if the customer is in a specific region.
  • Conditional rows in tables — Inside a loop, show or hide entire table rows based on a data value.

Example

Suppose you have an employee table and want to display the city name only for employees in North America. Your template would look like this:

  1. A ForEach Tag loops through the employee data.
  2. Inside the loop, an If Tag checks: is this employee's country in North America?
  3. If true, an Out Tag displays the city name.
  4. An Else Tag provides an alternative — for example, displaying "N/A".
  5. An EndIf Tag closes the conditional block.

In the generated output, North American employees show their city, while all others show "N/A".

If Tags vs. Switch/Case Tags

If you need to test a single condition (true or false), use If/Else/EndIf Tags.

If you need to test multiple different conditions and take a different action for each one, use Switch, Case, and EndSwitch Tags. They work like a series of If/ElseIf statements but are simpler to manage when you have many conditions.

ScenarioUse
One condition with two outcomes (true/false)If / Else / EndIf
Multiple conditions with different outcomesSwitch / Case / EndSwitch

How Do I Use an If Tag?

  1. Insert an If Tag — Use the Tags button on the Fluent Designer ribbon to insert an If Tag.
  2. Write a condition — In the Tag Editor's Query Pane, enter a Boolean expression (e.g., =${CostOfItems} <= 10 or =${Country} = 'USA').
  3. Add content — After the If Tag, place the tags, text, or images that should appear when the condition is true.
  4. Add an Else Tag (optional) — If you want alternative content when the condition is false, insert an Else Tag followed by that content.
  5. Insert an EndIf Tag — Close the conditional block with an EndIf Tag.
  6. Generate output — The content is included or excluded based on the condition.
tip

If Tags work naturally inside looping tags (ForEach, BeginRepeat, RowExpand). The condition is re-evaluated for each iteration, so different rows can produce different output.

Learn More

For a complete breakdown of all properties and configuration options, see the If Tag Reference.

For a detailed walkthrough with examples, see How Do I Use If, Else, and EndIf Tags?.