Reputation: 1214
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.
Here's the output from the run history:
It looks like the variable is an empty string at this point, however the condition fails without any helpful information.
I've also tried null or wrapping the variable in the empty command and comparing to true/false. All gave the same failure.
Upvotes: 5
Views: 27925
Reputation: 667
I have done this in 2 step process: Step 1: In compose connector If(equals(items('For_each')?['Email'],null), '',items('For_each')?['Email'])
Step 2: in Condition connector length(outputs('Email-EmptyOrNull')) is equal ZERO?
It works for me.
Upvotes: 0
Reputation: 3637
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.
Upvotes: 1
Reputation: 959
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.
Upvotes: 6