Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
Hi Champs,
I am using docx from dynamic template smart service to create dynamic document. It's working with simple table. Now I want to try with if else condition in my template. I am not sure the syntax to use to work with it.Can someone please guide how to do it if we have if/else condition .
Regards,
Shyam
Discussion posts and replies are publicly visible
Pre-compute the flag in expression (ageAbove30: if(r.age > 30, "true", "false")) and pass it in your XML/dictionary.In the template, use: «[#if r.ageAbove30 == 'true']»Above 30«[#else]»30 or below«[/#if]»Each [#if], [#else], [/#if] must be its own separate MergeField.
I tried the same «[#if r.ageAbove30 == 'true']»Above 30«[#else]»30 or below«[/#if]» but r.ageAbove30 is not taking as a boolean ; rather as an extended node+sequence+string and due to the same it's giving the error saying can't compare value of these types.
Try this once«[#if r.@ageAbove30?string == 'true']»Above 30«[#else]»30 or below«[/#if]»
Is there no other straight forward way to put the condition in the DOCX template? I mean without mentioned the datatype?