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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Sending Email based on...
Power Automate
Answered

Sending Email based on a filter array is creating an 'Apply to each' option that I don't want

(0) ShareShare
ReportReport
Posted on by 72

Hi there, I am having difficulty in send emails based on a filter array. The problem I have is that when I create the send email option, Power Automate automatically puts this into another 'Apply to Each' box which I do not want to happen. I simply wish to send one email, based on each row of the filter array.

 

I know that I need to type something in specifically when selecting the email itself, but am unsure of the code.

 

Any help welcome.

 

Pic1.jpg

Pic2.jpg

 

I have created an Apply to each step, but when I create the send email step and insert the email address I need, it automatically pops that into ANOTHER Apply each step, which I do not want.

 

How should the email be written to prevent this from happening?

 

The current code for the email says items('Apply_to_each')?['TestEmail'], which I think is causing the problem

Categories:
I have the same question (0)
  • Verified answer
    MarconettiMarco Profile Picture
    3,812 Super User 2024 Season 1 on at

    Hello @SteveODea ,

    inside the first "Apply to each" control you can add a "Compose" action in which put the following expression:

    item()['<your_value>']

     where replace "<your_value>" with the the TestEmail dynamics content.

    Then in the "Send an email" action, you can put the Compose outputs in "To" field.

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    BR,

    Marco

  • Verified answer
    ScottShearer Profile Picture
    25,280 Most Valuable Professional on at

    @SteveODea 

    You Flow could be much less complicated assuming that the column on which you are filtering is not a calculated column.

    You could use a filter query in your Get Items action and simply loop through the output.

    Here is a great reference on using a filter query.

     

     

     

  • SteveODea Profile Picture
    72 on at

    n

  • SteveODea Profile Picture
    72 on at

    Sadly, the item on which I'm filtering is a calculated column so need to take the more complicated route

  • SteveODea Profile Picture
    72 on at

    Many thanks @MarconettiMarco that worked. Quirky little solution and still not sure why this is required, but I'm not a coder, but I'll keep that one up my sleeve for next time

  • ScottShearer Profile Picture
    25,280 Most Valuable Professional on at

    @SteveODea 

    Since it is a calculated column, the solution suggested by @MarconettiMarco  should work well for you.  Just use the item() expression followed by the column name in your send an email action.  The Compose action is just a way to illustrate the point...

    image.png

  • SteveODea Profile Picture
    72 on at

    Many thanks

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 60 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 54

#3
Expiscornovus Profile Picture

Expiscornovus 47 Most Valuable Professional

Last 30 days Overall leaderboard