cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
laz8592
Helper II
Helper II

Flow error with email reminders

Error when I test the flow:

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

See screenshot below: 

laz8592_1-1636379113161.pnglaz8592_2-1636379195560.png

Please help, thanks. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
eliotcole
Super User
Super User

Hi, @laz8592, could it be that there's two additional Apply to each actions in that 'no' branch of your condition?

 

---

Anyway, thinking aloud I can think of two reasons you may be having issues:

 

Accidental Additional Apply to each Loops

If the 'Assigned Email' value is from a column in the 'Project Dashboard' list that contains a single email address, then you do not need those extra loops. Just use it directly and delete those.

 

Embedded Array/Data in 'Assigned Email'

If the 'Assigned Email' value contains multiple emails in an array, and within that they contain the email addresses to  send to, then you need to make the 'Assigned Email' value what the Apply to each 2 runs on. Then inside that loop you will pick the email field from that either with logic before building the email action, or from the items('Apply_to_each_2')?['FIELD_NAME'] field where FIELD_NAME is the address.

View solution in original post

2 REPLIES 2
eliotcole
Super User
Super User

Hi, @laz8592, could it be that there's two additional Apply to each actions in that 'no' branch of your condition?

 

---

Anyway, thinking aloud I can think of two reasons you may be having issues:

 

Accidental Additional Apply to each Loops

If the 'Assigned Email' value is from a column in the 'Project Dashboard' list that contains a single email address, then you do not need those extra loops. Just use it directly and delete those.

 

Embedded Array/Data in 'Assigned Email'

If the 'Assigned Email' value contains multiple emails in an array, and within that they contain the email addresses to  send to, then you need to make the 'Assigned Email' value what the Apply to each 2 runs on. Then inside that loop you will pick the email field from that either with logic before building the email action, or from the items('Apply_to_each_2')?['FIELD_NAME'] field where FIELD_NAME is the address.

Hi @eliotcole 

 

Thank you for very much for your help. 

 

Because the assigned column allows for multiple persons I needed to leave it in with the conditions. 

 

Your solution for Embedded Array/Data in 'Assigned Email' did work thank you. 

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.

Users online (3,708)