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

'Apply to each' inside an 'Apply to each'

Hi,

 

I'm trying to build a flow to copy tasks from the task planner to an excel table (with name of the task, the start date, due date and the assigned users) and get an error saying:

"The execution of template action 'Apply_to_each_3' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each')' is of type 'Object'. The result must be a valid array."

The 'Apply_to_each' refers to each task, the 'Apply_to_each_3' refers to the assigned users (as there can be more than one). Does anyone has an idea how to either build the flow different to avoid an 'Apply to each' inside an 'Apply to each' or how to solve the conversion issue with the array?

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

Hi @flake,

 

Just to double check. Are you using the List Tasks action from the Planner connector?

 

If so, you could use value assignments field (collection) in the second apply to each loop to loop through the assigned users.

 

You should be able to select that field as dynamic content. As an expression that would be:

items('Apply_to_each')?['_assignments']

 

value_assignments.png

View solution in original post

2 REPLIES 2
Expiscornovus
Dual Super User
Dual Super User

Hi @flake,

 

Just to double check. Are you using the List Tasks action from the Planner connector?

 

If so, you could use value assignments field (collection) in the second apply to each loop to loop through the assigned users.

 

You should be able to select that field as dynamic content. As an expression that would be:

items('Apply_to_each')?['_assignments']

 

value_assignments.png

It worked, thanks a lot!

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.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (3,003)