You can use XML tags to display information directly from MSR and to build IF statements in Word. IF statements let you set conditions for showing specific text or merge fields. For example, you might display one text in a placement confirmation for one business unit and a different text for another.
Create a Single IF-Statement
To start a conditional statement in Word:
Press Ctrl + F9 to insert the field brackets: { }.
Alternatively, navigate to the Insert tab, click Quick Parts, and select Field....
In the pop-up window, select If from the "Field names" list and click OK.
Structure the Statement
A standard IF-statement follows this structure:
{ IF "xml_tag"="expected_value" "text if true" "text if false" }
Condition: The requirement to check (e.g., "msf_business_unit" = "110 Uitzenden").
True Expression: The text or XML tag to show if the condition is met.
False Expression: The text or XML tag to show if the condition is not met. Use "" to show nothing.
Example:
{ IF "msf_business_unit" = "110 Uitzenden" "Stop B.V. hereby confirms your placement with Account_name" "" }
Use Nested IF-Statements
If you have multiple requirements, place one IF-statement inside another. This is useful for checking two or more conditions simultaneously.
Example (Business Unit AND Country):
To show text only if the business unit is "110 Uitzenden" AND the candidate lives in the Netherlands:
{ IF "msf_business_unit" = "110 Uitzenden" "{ IF "Candidate_othercountry" = "the Netherlands" "Stop B.V. hereby confirms your placement with Account_name" "" }" "" }
Configure False Expressions
You can also provide alternative text if a condition is false. For instance, showing different text based on residency:
If in NL: "Your tasks will be performed in the Netherlands."
If NOT in NL: "Your tasks will be performed in the European Union."
Important Notes
Exact Matching: Values (like "110 Uitzenden") must match the data in MSR exactly, including capitalization.
Double Quotes: Every component (the tag, the value, and the results) must be enclosed in double quotes "".
Spacing: Ensure there are spaces between the IF, the condition, and the result expressions.
Testing: Always test nested statements by generating the document multiple times with different record data before finalizing the template.
Review Notes
The XML tag msf_business_unit is used as a placeholder; ensure you use the actual tag name from your XML Mapping Pane.
When nesting, ensure the inner IF-statement is fully contained within the true or false quotes of the outer statement.