Hello All,
I have an XML generated and based on a valid XML tag I need to display the data.
«[#if doc.xml.A1 == "true"]»
«@before-row[#list doc.xml.good.A2 as l]«${1}» «@after-row[/#list]»
«[#else]»
«@before-row[#list doc.xml.good.A3 as l]»«${1}» «@after-row[/#list]»
«[/#if]»
In my case the If condition is not working when called from DOCX template which is called from a DOCX From Dynamic Template through a process.
I need to should 2 rows, but in the document it always shows 4 rows.
Can anyone help to check conditional logic is correct?
Thanks & Regards
Girish
Discussion posts and replies are publicly visible
[#if doc.xml.A1 = "true"]»
I would try with a single "=" sign. But I think it might also depend on whether A1 is a boolean or a String.
This thread has some examples: community.appian.com/.../docx-from-dynamic-template
As an alternative I would suggest that you put that if logic in whatever you use to generate the list in the XML before you send it for generation. I would put the least amount of logic in the word if you can avoid it as it is difficult to debug,
Hi girishk0002,
I previously faced this situation and the solution that I used is similar to what was recommended by mathieud0001. I implemented a logic during the XML generation that was validating if the value to be attributed was True of False. In case true I would give to the field (A1 in your case) the value, however is was false I would send null.
Than in the FreeMarker I used the following condition:
[#if doc.xml.A1?has_content]
I hope that help you.
Regards,
Acacio B.
Thanks for the response, but one more question can we hide a row based on the conditions in the word template. Please do help with a sample code snippet.
My recommendation would be for you to filter this data on Appian side, before you generate your XML, that way you have full control of the data that you want to send for your document generation.
Regards
Acacio B
Hi,
Thank you very much Mathieu and Acacio for the timely response. Instead of having a single table, I split the into 3 sections and added the logic to populated the data. To hide these sections added the If logic on a condition in the XML.
This way I could have a control on the data and also on the template.
Thanks again,
Thanks