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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (1,578)