cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnjohn123
Post Prodigy
Post Prodigy

The execution of template action 'Apply_to_each_8' failed: the result of the evaluation of 'foreach' expression '@outputs('Start_and_wait_for_an_approval_2')?['body/outcome']' is of type 'String'. The result must be a valid array.

I have an approval step, and then i am looping through the responses and check what the user responded, as follow:-

 

3optiosn.png

 

but i am getting this error:-

 

The execution of template action 'Apply_to_each_8' failed: the result of the evaluation of 'foreach' expression '@outputs('Start_and_wait_for_an_approval_2')?['body/outcome']' is of type 'String'. The result must be a valid array.

 

any advice on this please?

3 REPLIES 3
PrasadAthalye
Super User
Super User

If you have multiple approvals then the response is an array. You should check like below...

 

PrasadAthalye_0-1612572697230.png

 

if you have single approver, you don't need loop at all. Just check Outcome if it equals Approve OR Reject

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

@PrasadAthalyei tried your approach but i got the same error

Can you tell me what approach you tried and what error you got? Can you please upload a screenshot with the error and flow screenshot of the condition too?

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Kudoed Authors
Users online (2,316)