Contents
Index 🔎︎
\<bookmark_value\>matching conditional text in fields\</bookmark_value\>\<bookmark_value\>if-then queries as fields\</bookmark_value\>\<bookmark_value\>conditional text; setting up\</bookmark_value\>\<bookmark_value\>text; conditional text\</bookmark_value\>\<bookmark_value\>defining;conditions\</bookmark_value\>

# Conditional Text

You can set up fields in your document that display text when a condition that you define is met. For example, you can define the conditional text that is displayed in a series of reminder letters.

Setting up conditional text in this example is a two-part process. First you create a variable, and then you create the condition.

## To define a conditional variable:

The first part of the example is to define a variable for the condition statement.

1. Choose \<emph\>Insert -\</emph\>\<emph\>Fields - Other\</emph\>, and then click the \<emph\>Variables\</emph\> tab.

2. Click "Set variable" in the \<emph\>Type \</emph\>list.

3. Type a name for the variable in the \<emph\>Name\</emph\> box, for example "Reminder".

4. Click "Text" in the\<emph\> Format\</emph\> list.

5. Enter 1 in the Value box, and then click Insert.
   The Format list now displays a "General" format.

## To define a condition and the conditional text

The second part of the example is to define the condition that must be met, and to insert a placeholder for displaying the conditional text in your document.

1. Place the cursor where you want to insert the conditional text in your text.

2. Choose \<emph\>Insert -\</emph\>\<emph\>Fields - Other\</emph\>, and then click the \<emph\>Functions\</emph\> tab.

3. Click "Conditional text" in the \<emph\>Type \</emph\>list.

4. Type \<emph\>Reminder EQ "3"\</emph\> in the \<emph\>Condition \</emph\>box. In other words, the conditional text will be displayed when the variable in the field that you defined in the first part of this example is equal to three.

   The quotation marks enclosing the "3" indicate that the variable that you defined in the first part of this example is a text string.

5. Type the text that you want to display when the condition is met in the \<emph\>Then\</emph\> box. There is almost no limit to the length of the text that you can enter. You can paste a paragraph into this box.

6. Click \<emph\>Insert\</emph\>, and then click \<emph\>Close\</emph\>.

## To display the conditional text:

In this example, the conditional text is displayed when the value of the conditional variable is equal to 3.

1. Place your cursor in front of the field that you defined in the first part of this example, and then choose \<emph\>Edit - Fields\</emph\>.

2. Replace the number in the \<emph\>Value \</emph\>box with 3, and then click\<emph\> Close\</emph\>.

3. If the field does not automatically update, press F9.

נושאים קשורים

Querying User Data in Fields or Conditions

Conditional Text for Page Counts

Defining Conditions

List of conditional operators