--- title: "Using conditions to show or hide text" slug: "using-conditions-to-show-or-hide-a-text" description: "Learn how to add conditions to text in Word templates using dox42, displaying messages based on participants' success levels for customized reports." tags: ["AddIn V5.0.4.2", "task"] updated: 2026-11-03T12:09:37Z published: 2026-11-03T12:09:37Z canonical: "help.dox42.com/using-conditions-to-show-or-hide-a-text" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.dox42.com/llms.txt > Use this file to discover all available pages before exploring further. # Using conditions to show or hide a text *This content applies to:* ![](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/DOCX-Add-In_IconBadge.svg) --- You can add conditions to a text so that it is displayed depending on that condition. For example, you want to show a specific message on a training report depending on the participant’s success level. ## Steps 1. In Microsoft Word, open your document template. 2. Go to the **dox42** ribbon and select **Insert** **Data Field.** ![Toolbar displaying various functions like Generate, Data Map, and Refresh Template options.](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/setting-up-the-d365-fscm-data-sources-image-6me2xixz.png) **dox42** ribbon The **dox42 Data Fields** explorer opens, which contains all the components of the data map. 3. Select the text you want to add a condition to. In this example we only want to display the text “That was awesome” for the best participants. 4. Enter and select the text. 5. Go to the **dox42** ribbon and select the **Automate Range** button. The **dox42** **Automate Range** window opens. 6. Select the **Insert Data Field** button. 7. Choose the data field which is required for the condition. Example: `Participants.Success` 8. Select an operator from the **Insert Operator** dropdown. If more than one condition is needed, it is possible to combine the condition with the operators from the **Insert Logic Operator** dropdown. 9. Enter the desired value for the condition. > [!NOTE] > Note > > If the value is a text string you need to set it in quotation marks: `“condition text"` . Example: A condition meaning that the text should only be displayed if the participant’s success level equals the text “Distinction”. ![Configuration settings for dox42 Automate Range with condition for success distinction.](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/Bildschirmfoto 2025-04-28 um 15.33.22.png) 10. Optional: Select a colour from the **Colour** dropdown. > [!TIP] > Tip > > We recommend using different colours for your conditions so that you can keep an overview, in case you have various or nested conditions in your template. 11. Select the **Insert** button. The condition is inserted. You can recognise conditions by the question mark icon (condition tag). !['That was awesome!' text with condition](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/Bildschirmfoto 2025-04-28 um 15.33.41(1).png) Data field with condition > [!TIP] > Tip > > By moving the condition tags, you can flexibly move the start and end of the condition, e.g. to include a line break or page break. ## Result You have added a condition to a text. When you [generate](/v1/docs/generating-a-document-for-testing) the document, it will only show this text for participants that have passed with distinction. ![Generated document template with 'That was awesome' message](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/Bildschirmfoto 2025-04-28 um 15.37.58.png)