Question
Document Generation (Word): Inequality / negation in conditional-section inside repeating-section not working as expected
Hello,
I am using the Document Generation API with a Word template, and I’m encountering unexpected behavior when using conditional-section inside a repeating-section.
The Template tags I am using in word doc:
{% repeating-section data.group_family.products %}
{% conditional-section expr(id = "soft_bundles") %}
Table 1
{% end-section %}
{% conditional-section expr(id != "soft_bundles") %}
Table 2
{% end-section %}
{% end-section %}Sample JSON:
{
"data": {
"group_family": {
"products": [
{ "name": "Soft Bundles", "id": "soft_bundles" },
{ "name": "Product A", "id": "prod_a" },
{ "name": "Product B", "id": "prod_b" },
{ "name": "Product C", "id": "prod_c" },
{ "name": "Product D", "id": "prod_d" },
{ "name": "Product E", "id": "prod_e" }
]
}
}
}Questions
- Is there a known limitation or special handling required for inequality (
!=) or negation (not()) insideconditional-sectionwhen used within arepeating-section? - In
expr(...), what does$or$.fieldrefer to?- The current repeating item?
- Or the root document?
- Can Word content control boundaries (e.g., conditional sections split across paragraphs or controls) cause different evaluation contexts, even if the template appears correctly nested?
Thank you!
