web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / "Apply to Each" fails ...
Power Automate
Unanswered

"Apply to Each" fails to send email when a Dynamic Value is used for the email address

(0) ShareShare
ReportReport
Posted on by 33

I'm trying to generate a reminder email only for items that are NOT complete and in between a reminder date and a due date. It works and sends the email when the email is hard-coded (blah@blah.com) , but fails if I try to use the "Author email" field from the associated SharePoint list.

 

My Power Flow is associated with a SharePoint list.

  1. Get items:
    1. Only items with a "Status" NOT EQUAL to "Complete". "Status" is a column from the SharePoint list.
    2. Filters columns by using "Limit Columns by View". I made sure to include the multiple person/group column, "Author" which I use later for the email.
  2. Condition: Today's date is greater than the "Reminder Date" and less than or equal to the "Due Date".
  3. Switch on "Status": For testing, I am only handling the case where Status equals "Writing Report".
  4. Send an email: This is where I need help. If I hard-code an email address, it sends the emails without error. But if I use the Dynamic Value "Author Email" it errors and fails to send the email. NOTE: The "Apply to each 2" step with "Current item" was generated automatically when I added the Author Email field.

The ERROR:

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.
 

1.png

2.png

3.png

Categories:
I have the same question (0)
  • v-yetonggu-msft Profile Picture
    on at

    Hi @marmot777 ,

    Please try to replace the current item dynamic content with Author dynamic content.

    vyetonggumsft_0-1713487725533.png

     

    Best Regards,

    Sunshine Gu

     

     

  • marmot777 Profile Picture
    33 on at

    Hi Sunshine Gu, thanks so much for taking a look at my problem. I tried to do exactly what you said, but it instead it created another "Apply to each" step (see below). It won't let me put in just "Author Email" by itself. When I tried running it, it gave me the exact same error in the exact same place.

    Screenshot 2024-04-18 204006.png

  • v-yetonggu-msft Profile Picture
    on at

    Hi @marmot777 ,

    Your Author column should be a multi-select person column, right?

    If so,please check this test:

    In my scenario:

    vyetonggumsft_0-1713500600219.png

     

    item()?['Email']
    join(body('Select'),';')

     

    Best Regards,

    Sunshine Gu

  • marmot777 Profile Picture
    33 on at

    Novice here...but I can't make my flow look like yours. Again, it added another "Apply to each".

    flow.png

    error.png

  • v-yetonggu-msft Profile Picture
    on at

    Hi @marmot777 ,

    Please carefully check the configuration parameters in 'Select':

    vyetonggumsft_1-1713504136351.png

    Best Regards,

    Sunshine Gu

  • marmot777 Profile Picture
    33 on at

    I tried both "Author" and "Author email" but ended up with the same error.

    1.png

    2.png

    3.png

  • Verified answer
    v-yetonggu-msft Profile Picture
    on at

    Hi @marmot777 ,

    Please delete Apply to each3 and change Author Email to Author.

    vyetonggumsft_1-1713506481546.png

    Best Regards,

    Sunshine Gu

     

     

  • marmot777 Profile Picture
    33 on at

    With your help, I was able to get the following working and sending emails. Is this the solution, or was this a test and you have something else in mind.

     

    THANK YOU!!

     

     

    Screenshot 2024-04-19 141105.png

  • marmot777 Profile Picture
    33 on at

    Also, if this is the solution, what is the most efficient way to add more email addresses to CC to?

  • v-yetonggu-msft Profile Picture
    on at

    Hi  @marmot777 ,

    If I solve your problem, please mark my response as a solution so I can help more people who are experiencing this challenge in the future.

    For your new question, you can re-post it on the forum so that more people can see it, which will solve your problem more efficiently.

    Best Regards,

    Sunshine Gu

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard