1. Help Center
  2. Document Generation for Mendix

How to Use Conditional Formatting in Word

Conditional formatting in Word allows you to customize the content of your documents based on specific conditions, making your documents more dynamic and responsive to data changes. When generating documents in Mendix, you can use this feature to tailor the output according to different data values.

Here's how to use conditional formatting in your Word templates: 

1. Insert an IF Fields: 

  • Open your Word document template
  • Place the cursor where you want the conditional content to appear 
  • Press Ctrl + F9 to insert the field brackets {}.

2. Define the Condition: 

  • Inside the brackets, write an IF statement. For example: 



3. Test the Conditional Logic:

  • Run a test document generation to verify that the correct content appears for each condition
  • Adjust the logic or add more conditions as necessary 

4. Save and Implement 

  • After confirming the logic works as intended, save the template and use it in your Mendix application 

For example: The generated document may appear like this, depending on the details in the invoice record.