I am working with some data from an API where need to look at some values from a JSON file. I am using the apply each and then using compose to get the values of an array. Unfortunately, some of the keys I am looking for do not exist so Power Automate is failing.
Is there a way that if it fails that it returns a null value???
Solved! Go to Solution.
Hi @dcafiero,
You could use Parse JSON action to parse these data, then you could use dynamic content in next actions.
I use an instance to explain, I have a JSON as below, the Age property is not required, some item does not contain it. Then put the "Name" array into Apply to each action, if the Age property does not exist in the item, it will return null:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dcafiero,
You could use Parse JSON action to parse these data, then you could use dynamic content in next actions.
I use an instance to explain, I have a JSON as below, the Age property is not required, some item does not contain it. Then put the "Name" array into Apply to each action, if the Age property does not exist in the item, it will return null:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I will try what you mentioned.
I was able to handle this for the time being by in my compose adding an if statement if it doesn't contain a value to return null.
if(contains(variables('trackerRows').cells[9], 'value'), variables('trackerRows').cells[9].value, 'null')
Thanks this worked perfectly for me.
User | Count |
---|---|
88 | |
37 | |
26 | |
13 | |
13 |
User | Count |
---|---|
127 | |
54 | |
37 | |
24 | |
21 |