4
votes

Solved

Issue was due to error in child action as Thomas pointed out, not the way I was checking the variable value.


I've got a variable that's been initialized earlier in the LA. Later on I'm trying to check if the variable is empty using a condition.

enter image description here

Here's the output from the run history:

enter image description here

enter image description here

It looks like the variable is an empty string at this point, however the condition fails without any helpful information.

enter image description here

I've also tried null or wrapping the variable in the empty command and comparing to true/false. All gave the same failure.

2
Can you try something like that :@length(if(equals(triggerOutputs()?['headers']?['SAS-Uri'], null), '', triggerOutputs()?['headers']?['SAS-Uri'])) - Thomas
@Thomas - tried it but no luck. Are the ?'s like null conditional operators in c#? - Joey Eng
Yes the ? Is a null propagation operator - Thomas
The error message said that another action failed. Have you check your workflow ? It sounds like a child action is failing - Thomas
Ah, that was the problem. I assumed it was the condition action causing the problem, but it was a child action. I need to pay better attention to the message. Thanks! - Joey Eng

2 Answers

6
votes

You can use the length function in the expression. I've found it helpful to also coallesce the value to an empty string before checking length.

0
votes

For me placing an empty string between double quotes in a condition action to recognize the empty string works well. Be aware however that once you enter the empty string in the condition action and save your logic app, if you afterwards go back in the designer and reopen the condition action the empty string enclosed in double quotes ("") is not displayed anymore.

enter image description here