cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Apply to each error

I'm sure this has got a very simple solution, but I just can't figure it out.

My Flow used to run quite nicely until this week where there seems to be an added 'Apply to Each' bit which has caused everything to fail. The error that comes up is:

 

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

I am trying to build a flow where

1. An item is added to sharepoint and two approvers are designated; first and final

2. This item gets sent to gatekeeper for approval

3. Gatekeeper approves
4. Item gets sent to first approver for approval
5. First approver approves
6. Item updated with date for #5
7. Item gets sent to Final Approver
8. Final approver approves
9. Item updated with date for #8

This used to run smoothly, but now stops at #3 where this new 'apply to each' bit is and it's asking for an array rather than an object and I can't for the life of me figure out how to get this to work; I've tried nesting approvals 4-9 within the same 'apply to all' and not nested (2-3 do not have this bit). Any assistance would be highly appreciated!

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Apply to each error

Hi @SSwan,

 

Could you please share a screenshot of your flow's configuration?

Could you please show a bit more about the "Apply to each" action within your flow?

Further, could you please share a bit more about the First Approver column in your SharePoint list?

 

The error message told that the "Apply to each" action is required to provide a valid array, but the result the expression you provided returned is Null. Please check if the First Approver column has values (is not empty) within your SharePoint list.

 

If you could provide more details about your scenario, we would provide a proper workaround for you.

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: Apply to each error

Hi, I am Facing Same issue. Error Message "The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON_2')?['body']?['value']' is of type 'Null'. The result must be a valid array." Until Last week it was working find and the Suddenly Stops. Thanks, Shantanu
Highlighted
Advocate II
Advocate II

Re: Apply to each error

Did anyone manage to resolve this issue? I am getting the same error.

Memorable Member
Memorable Member

Re: Apply to each error

It seems that this error occurs quite often.

I have a Flow that runned perfectly 4 days ago and now I'm getting the same error as you guys.

 

 

My error is a little bit different in that matter that my item is an Object and isn't null. So I don't know what happened here.

 

Feels very unstable and is kinda unreliable to implement this in a live environment.

 



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (9,445)