Is it possible to interpolate another value inside a map function when conditionally rendering content? I’m using the classic DOCX template.
Here’s an example of what I’ve tried (though I may have the syntax wrong):
{{changeOrderType}:map(
"scopeOnly"="show scope only and {{arbitraryValue}} with DIFFERENT supporting text that must be shown for this value along side the arbitraryValue",
"timelineOnly"="show timeline only text with the same post text",
"scopeAndTimeline"="show scope and timeline text with the same post text"
)}
I’m trying to determine whether nested interpolation (for example, {{arbitraryValue}}) is supported inside the mapped output, or if there’s a different pattern (e.g.,rich text content control) I should be using.
Unfortunately, it’s not possible to use values from other tags/tokens inside the map() function in the Classic engine. Only plain text is supported there.
However, this may be possible with the Modern engine. I’ve passed your request to our development team so they can look for the best solution. I’ll let you know as soon as I have an update.
Thanks for the response. Ultimately, what I ended up doing was creating a new data object in Power Automate that contained all of the properties and values I needed to access. Then, instead of using map, I used an if condition to render the desired text along with its associated properties.
This approach avoided the need for nested interpolation (since its not supported currently) and gave me more control over the rendered output.
That’s great! Nice find, and I’m glad it works well as a workaround.
Good news: we’re finalizing native if/else conditional logic directly in Plumsail Documents, so you’ll be able to do the same thing without Power Automate very soon.
The new if/else conditional logic is available in Plumsail Documents and can be used with the Modern engine. If you’d like to try it, please see the example below: