I need to check if an object exists.
Example Compose:
[ { "category5": true } ]
"category5" could be any number from 1-6 e.g "category2" etc..
How can I check the Output of Compose to see which category is set to true? I have tried to loop through an array of categories 1-6 and checking if empty, but I keep getting an error because the only category that exisits is boolean.
Error: Unable to process template language expressions for action 'Condition' at line '1' and column '2639': 'The template language function 'empty' expects its parameter to be an object, an array or a string. The provided value is of type 'Boolean'. Please see https://aka.ms/logicexpressions#empty for usage details.'
Solved! Go to Solution.
Hi @String ,
Please try to use the following configuration.
First store the expected categories in an array variable, then traverse the Output to see if the expected category exists.
You could download the .zip file from the attachment and import it as a new Flow to test.
Hope it helps.
Best Regards,
Hi @String
[ { "category5": true } ]
The above Compose action generates an array
Expressions can be
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @String ,
Please try to use the following configuration.
First store the expected categories in an array variable, then traverse the Output to see if the expected category exists.
You could download the .zip file from the attachment and import it as a new Flow to test.
Hope it helps.
Best Regards,