Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Apply to each failure due to null value from parsing JSON

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!



Resident Rockstar
Resident Rockstar

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.

Community Support
Community Support

Hi @JSGarrett,


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:

Annotation 2019-12-09 170557.png


Annotation 2019-12-09 170611.png


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.

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,695)