cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahhunter
New Member

"Apply to each" failure

Hello, all!  Power Automate informs me that this is a "new issue" and I should ask the community for help!  I get the following error when I test a flow I've created:

 

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

The purpose of the flow is to send the responses from a Form I created to a pair of other people in my office.  Here's what the flow looks like.  Does anyone have any tips on what I'm doing wrong?  Thanks so much!

 

Space request form flow.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Nived_Nambiar
Resolver III
Resolver III

Hi @ahhunter 

try to use 

array(triggerOutputs()?['body']) instead of body alone.
 
It will resolve your issue
 
Mark it as solution if it helps
Regards,
Nived N

View solution in original post

This worked - thank you so much!  For other newbies like myself, I had to enter that formula as an Expression rather than as dynamic content.Capture.PNG

View solution in original post

4 REPLIES 4
Nived_Nambiar
Resolver III
Resolver III

Hi @ahhunter 

try to use 

array(triggerOutputs()?['body']) instead of body alone.
 
It will resolve your issue
 
Mark it as solution if it helps
Regards,
Nived N

This worked - thank you so much!  For other newbies like myself, I had to enter that formula as an Expression rather than as dynamic content.Capture.PNG

thanuramarapana
New Member

Thank you. This worked like a charm!

Hi @Nived_Nambiar , I have a similar situation but in my case I get this error:
The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Compose')' is of type 'String'. The result must be a valid array.

In my '@outputs('Compose')', I have this function - base64(outputs('Get_file_content')?['body']). When I try to put this in the "Select an output from previous steps", it returns the above error. Do you have any solutions for this

?

fayanan_0-1659535255860.png

 

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Top Kudoed Authors
Users online (5,500)