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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to filter a column...
Power Automate
Unanswered

How to filter a column in excel and send an email containing the filtered data

(0) ShareShare
ReportReport
Posted on by 49

I have a table like below:

Capture13.PNG

I want to create a flow which will filter based on email address and send email with the filtered data to the email address mentioned in the Email column.  The email address are duplicate in the table, so only one email should be send to each email address.

Categories:
I have the same question (0)
  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at
    Re: How to filter a column in excel and send an email containing the filtered data

    Hi,

     

    Try this:

     

    1. List rows present in the table

    2. Add a 'Send an email'

    3. Add the column with email in the "To" field, which will automatically create an apply to each

    4. Then add the other columns in your excel sheet below.

    Heartholme_0-1652424998118.png

    This will iterate through each row and send the information from the other columns (of that row).

     

    Let me know how it goes 😄

     

    { If my post answered your question, please Accept it as a solution ✔ }
    { This will in turn help others find solutions to similar questions }

    Best Regards
    Heartholme

     

     

  • RobertJames Profile Picture
    49 on at
    Re: How to filter a column in excel and send an email containing the filtered data

    Thanks for the response, however the email column has duplicates and I want to filter the excel table with the email and send email only once. Also the email should be properly formatted as html file without any extra odata columns.

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at
    Re: How to filter a column in excel and send an email containing the filtered data

    @RobertJames 

     

    Unfortuneatly, Power Automate dosen't have distinct() function to filter out duplicates. I think this should work, though I tried to verify it now without success, you could take a look:

     

    https://powerusers.microsoft.com/t5/Building-Flows/Filtering-Unique-values/td-p/531930

  • Verified answer
    Ellis Karim Profile Picture
    11,653 Super User 2025 Season 2 on at
    Re: How to filter a column in excel and send an email containing the filtered data

    There is some work involved in removing the duplicates email addresses and then sending a single message containing their items. As mentioned by @Heartholme  there is no distinct function in Power Automate but the Union function can be used to remove duplicate email addresses:

     

    Snag_1129ae3.png

     

    Snag_1142d3b.png

    The following expression will remove the duplicate email addresses:

    union(body('Select'),body('Select'))

     

    Then for each email address we will collect the items as recorded in the Excel file and send an email to each recipient:

    Snag_12caf28.png

    For each email address:

     

    Snag_118b582.png

    Filter the data from Excel based on the current email address of the loop:

    Snag_119ffb6.png

     

    Next we select just the item values (i.e. Clothes, Shoes, Housegold items, Sports equipment and Furniture etc) from the Filter Array action: 

    Snag_120b5ca.png

    This is the expression used in the Select Items action:

    item()?['Items']

     

    Finally join all the items together using a comma, into a single text string:

    Snag_1268bde.png

    Finally, I simulate the Sending of the email:

    Snag_12ac838.png

    Three emails will be sent with the following content:

    Snag_1350715.png

    Hope this helps.


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

  • RobertJames Profile Picture
    49 on at
    Re: How to filter a column in excel and send an email containing the filtered data

    @ekarim2020 , thanks for the detailed response. How can I format the filtered data as a proper html table and include the html table in the body of the email which is sent.

  • v-xiaochen-msft Profile Picture
    on at
    Re: How to filter a column in excel and send an email containing the filtered data

    Hi @RobertJames ,

     

    You could use 'create html table' action. This action can convert array to html table.

    vxiaochenmsft_0-1652771209705.png

     

    Best Regards,

    Wearsky

     

  • RobertJames Profile Picture
    49 on at
    Re: How to filter a column in excel and send an email containing the filtered data

    thanks, I will try it out

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
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard