I have an manually triggered flow.
This is the error message:
Unable to process template language expressions in action 'Create_item' inputs at line '0' and column '0': 'The template language function 'if' expects three parameter: the condition to test as the first parameter, the value to return if the condition is true as the second parameter, and the value to return if the condition is false as the third parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#if for usage details.'.
The expression is
if(empty(triggerBody()['text_1'],' ',triggerBody()['text_1']))
the condition to test as the first parameter: if(empty(triggerBody()['text_1']
the value to return if the condition is true: ' '
value to return if the condition is false: triggerBody()['text_1']
What went wrong?
HI @SharonS
You can also put the ? there so triggerBody()?[xxxx]
If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others
Cheers
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey
Hi @FLMike
I changed the expression and
received this error message. Note I left the Text field blank in the test run. When I put text in the field, it ran successfully.
Unable to process template language expressions in action 'Create_item' inputs at line '0' and column '0': 'The template language expression 'if(empty(triggerBody()['text_1']),' ',triggerBody()['text_1'])' cannot be evaluated because property 'text_1' doesn't exist, available properties are 'text'. Please see https://aka.ms/logicexpressions for usage details.'.
Hi @SharonS
If you break down your code it actually is like this
if(
empty(triggerBody()['text_1'],
' ',
triggerBody()['text_1']
)
)
but should be like this
if(
empty(triggerBody()['text_1']),
' ',
triggerBody()['text_1']
)
you have the paran to CLOSE the empty check at the END not at the END of the empty check itself, so the if statement looks like it gets one input instead of the correct format.
If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others
Cheers
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey