cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
timalex
Helper I
Helper I

Unable to use results of JSON Parse in Flow

I need to use the results of my Parse JSON action to complete an apply to each action and each time i try the value of 'ID" is coming thru as NULL. 

 

If i hardcode the value that i get from my Parse JSON output into the HTTP action it works fine, but that's defeating the purpose to try and automate it. 

 

 

timalex_0-1623840751701.png

 

 

timalex_1-1623841006630.png

 

This is what happens when it is contained in a Apply to Each Action

timalex_2-1623841093160.png

The error is:

 

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON_2')?['id']' is of type 'Null'. The result must be a valid array.

 

timalex_3-1623841181616.png

What the heck am i missing here?

 

This should be easier than it is. 

1 ACCEPTED SOLUTION

Accepted Solutions
timalex
Helper I
Helper I

So the answer for some reason is to parse the body of the first JSON parse of the API body. Have no idea why that worked, and at this point don't care. 

 

timalex_0-1623878040640.png

 

View solution in original post

4 REPLIES 4
Expiscornovus
Dual Super User
Dual Super User

Hi @timalex,

 

In your error message it says it is referring to a Parse Json action with the name 'Parse JSON 2'. However, in your screenshot the name of the action is Parse JSON to then perform a ForEach Retry SSL Validation.

 

Is the reference to the id field correct in your HTTP request action?

 

I would have expected this:

body('Parse_JSON_to_then_perform_a_ForEach_Retry_SSL_Validation')?['id']

 

timalex
Helper I
Helper I

So that's a very good catch, my screenshots are from different iterations of that flow which is why you've caught that. 

 

Please let me know what information i can provide that will help you help me. I really need to get this thing working and i don't understand why i can't USE the data in the JSON to kick off a apply for each on my HTTP patch call. 

 

i appreciate the help. 

timalex
Helper I
Helper I

So the answer for some reason is to parse the body of the first JSON parse of the API body. Have no idea why that worked, and at this point don't care. 

 

timalex_0-1623878040640.png

 

timalex
Helper I
Helper I

Oh, and i failed to mention that you use the dynamic results from the SECOND 'ParseJSON' action within your Apply to each action. 

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,707)