So I am in the process of trying to build a Flow for Office 365 alerts, one that actually includes the messages and not simply an alert status (those exist out there). However, the messages portion of the Office 365 Service Communications API, when parsed in Flow, seems to return some Null values in the array. So whenever I try to run it, I get the error below. At least, I assume some of the values are null, since I am getting a boatload of output back from MS and it is being parsed. I have yet to find any kind of definitive answer on how to get the "Apply to each" to simply ignore null values and move on. Any assistance would be greatly appreciated. Thank you!
I think you would need to do some clean up before the apply to each.
I do not have the exact solution, but i expect you can create an array variable and then add to it for each record in the JSON skipping the ones that are null.
You could try these methods, one is creating a condition to determine the output of Parse JSON whether is null by using empty() function or length() function, if you use the empty(), the condition on the right side should null, if using the length, the right side should be 0; the other is use the Configure after run to select has failed, you could set it at the following action, if the output of Parse JSON is null, the apply to each will failed, and then the following action will continue run:
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.