Conditional Text allows you to include both static and dynamic text content as an inline element into your outputs entirely dependent upon your data source.
This article's aim is to cover the following information:
- Inserting a Conditional Text
- Editing a Conditional Text
- Deleting a Conditional Text
Inserting a Conditional Paragraph
To insert Conditional Text, follow the instructions provided below.
- Select the Insert tab from the Ribbon;
- Click the Conditional Paragraph button from the Dynamic group;
Next, you will be presented with the Insert Conditional Text Dialog where you will need to set your initial condition.
- Select in the Data Tree the data value to base your condition on;
In this example, the "year" attribute will be used;
- Choose the type of condition based on available options: on occurrence, numerical value, or text value. In our example, we will test the numerical value, the year needs to be greater than 1980;
- After adding the conditions click Insert.
Adjusting the condition's content
The text that will appear on your Design Surface is contained in an if…else block: if the condition is respected, only the first part will be displayed, otherwise, only the second part.
You can replace the text inside the conditional text with the dynamic or static content that you wish to display for condition and fallback sections.
The result of our condition will be:
Insert, Edit and Delete conditions
After inserting a Conditional Text, when selecting it from the Design Surface, a new tab will appear in the Ribbon, the Text tab, where you will find the conditional tools, buttons to Insert, Edit and Delete the conditions.
Note: All these options can be accessed by right clicking on the conditional text and selecting them from the contextual menu.
- When clicking the Delete button you will be presented with two options: Active Condition and All Conditions
- If all conditions will be deleted from the conditional text, the entire Conditional Text structure will be removed from the document:
- If you wish to remove the else part of our condition and not display a message when no conditions are met, de-select the Has Else checkbox from the Sequence group.
- The Edit button in the Condition group offers the possibility of editing the conditions for the conditional paragraph.
- New conditions to the Conditional Text can be inserted from the Insert button.
All these actions can be done from the Conditions button in the Sequence group.