On my 'For a selected file' trigger, I've set up several optional text inputs. If an input is unused (skipped), it disappears from the triggerBody array. If I try to test the input for content the flow fails because the input no longer exists. I'm left with the message:
'Unable to process template language expressions in action 'Grab_additional_information' inputs at line '1' and column '2103': 'The template language expression 'if(empty(triggerBody()['text_3']),'',triggerBody()['text_3'])' cannot be evaluated because property 'text_3' doesn't exist, available properties are 'entity, text'. Please see https://aka.ms/logicexpressions for usage details.'
The triggerBody array needs to be static, with empty values being returned for unused inputs - this way we can use if(empty()) to test for meaningful content without failing the flow. This is a major sticking point for me. The worst part is that the behaviour seems intermittent such that if I copy the optional value into a variable at the start of the flow, sometimes it works and sometimes it doesn't.
Please sort this out. I'm losing faith.
Also - your error messages always seem to state: 'line '1' and column '2103'' regardless of the nature of the error - which means nothing to someone building a flow in the usual manner.
Thanks.
Solved! Go to Solution.
Hi @Anonymous ,
Have you set the input as required?
Please make sure you have selected Make this field optional, then the flow won’t failed even you don’t give a value for this field.
Best regards,
Mabel
Hi @Anonymous ,
How long have you left the Input unused?
Could you share more details on this issue?
According to your description, I have set up the flow with the trigger “For a selected file”, then add two optional Text inputs.
Compose with dynamic content Input1.
Compose2 with the following code:
if(empty(triggerBody()?['text']),'',triggerBody()?['text'])
Then I try to trigger the flow several times with Input unused, however, the issue you mentioned doesn’t occur.
Please share more details to help reproduce this issue.
Best regards,
Mabel
Hi,
Thanks for your interest.
Here's my setup...
Of the inputs shown, only the 'Further information' input is optional. In this case I filled the mandatory inputs and skipped the optional one. If I put information in, it works. If I leave it empty the flow fails.
I've had this issue on several occasions with different flows - To resolve it I remove all the inputs, set them up again, and then re initialize the variables - this usually works but will often take several iterations.
And here's the outcome...
Hi @Anonymous ,
Have you set the input as required?
Please make sure you have selected Make this field optional, then the flow won’t failed even you don’t give a value for this field.
Best regards,
Mabel
I have exactly the same problem. Inputs are strings and are marked as optional.
If I leave it blank when running the flow, the actual item does not exist at runtime, therefore I cannot check it because I cannot even mention it's name without causing an exception.
btw did anyone notice that many threads here are marked as having a solution however when you click on "goto solution" it takes you to a post where someone has a footer saying "please Accept this a solution". Maybe you guys should remove or reword that footer so it does not disrupt the system - thanks
George
Here is some proof.
First of all it should be noted that the optional field was created as the 1st field, now I find the order inverted
leaving the optional field blank and "t2" in the mandatory field....
This is getting wierder and wierder.
I solved the problem using coalesce (which should not happen of course).
I have the same issue. Any comments?
I solved it by checking if the optional input is entered or not with this condition:
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.