Hi All,
I'm building a flow to populate a Word template. The template contains some fields that are optional which I want to hide when the value is null.
To achieve this I'm trying using to use repeating sections in the template as suggested in this blog: https://joelblogs.co.uk/2021/06/28/microsoft-flow-tip-1-word-templates-and-hiding-empty-repeating-sections/. Basically this says to pass a blank array to a repeating section in the "Populate a Microsoft Word template" action to hide it.
This all works fine, but how do I pass an empty array if the value of the item inside the array is null?
I have tried the below for the input of the field connected to the repeating section, but apparently the expression is invalid:
[
if(
equals(
outputs('Get_item')?['body/OptionalField'],
null
),
null,
"OptionalField": outputs('Get_item')?['body/OptionalField']
)
]
Looking forward to your ideas/solutions!