Skip to main content

Introduction to the Set Tag

What Is the Set Tag?

The Set Tag creates a variable and assigns it a value — a string, number, or expression — that you define directly in the tag. That variable can then be referenced anywhere in your template by other tags using ${VariableName} syntax.

Unlike the Retrieve Data Tag, which queries a data source and stores the result, the Set Tag's value is defined by you in the Tag Editor. It does not produce any visible output in the generated document.

Why Use a Set Tag?

Set Tags are useful any time you need a reusable value that isn't pulled directly from a data source. Common scenarios include:

  • Constants — Define a value once (e.g., a company name, report title, or tax rate) and reference it in multiple places. If the value changes, you only update the Set Tag.
  • Calculated values — Build an expression that combines data from other variables or data source fields.
  • Dynamic queries — Use a Set Tag variable inside another tag's select statement to create parameterized queries. For example, set a variable to an ID value, then use ${id} in SQL statements throughout the template.
  • Conditional logic — Use a Set Tag variable in If Tag or display conditions to control what appears in the output.

How Variables Work

When a variable created by a Set Tag is referenced in another tag's query, the variable's value is substituted before the expression is evaluated. For example, if ${var} has a value of 4:

  • The comparison =2 < ${var} becomes =2 < 4, which evaluates to true
  • The SQL statement SELECT name FROM products WHERE ID = ${var} becomes SELECT name FROM products WHERE ID = 4
  • The literal string 'My ID number is ${var}.' becomes My ID number is 4.

Set Tag vs. Retrieve Data Tag

Both tags create variables, but they serve different purposes:

Set TagRetrieve Data Tag
Value sourceDefined directly by you (string, number, expression)Queried from a data source
Data sourceNot requiredRequired
StoresA single valueThe first row or node of a query result
Use caseConstants, calculations, parameterized queriesCaching queried data for reuse

How Do I Use a Set Tag?

  1. Insert a Set Tag — Use the Tags button on the Fluent Designer ribbon and select Set Tag.
  2. Enter a value — Open the Tag Editor and type your value (a string, number, or expression) in the Query Pane.
  3. Name the variable — Set the var property (e.g., companyName). This is the name other tags will use to reference the value.
  4. Reference the variable — In other tags, use ${companyName} to insert the value wherever you need it.
tip

Place Set Tags at the top of your template so their variables are available to all tags that follow. A variable can only be referenced by tags that appear after the Set Tag in the document.

Example

Suppose you want to display a report title in a header, a footer, and the body of your document:

  1. Place a Set Tag at the top of the template. In the Query Pane, enter Quarterly Sales Report. Set the var property to reportTitle.
  2. In the header, body, and footer, use Out Tags with ${reportTitle} in their select statements.

If the title ever changes, you only need to update the Set Tag — every reference updates automatically at generation time.

Learn More

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

For a step-by-step walkthrough, see How Do I Use a Set Tag?.