cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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

Hi,

I'm trying to create a process to help me filter an excel column, get that data, and send an email to some identified email in another sheet.

to give a better view I have created "some kind" of a visual flow to try to explain the difficulty and if it's possible to create.

 

 

flow - Word.png

 

I do not know if I can attach the excel file, but I leave the prints below

file1.pngfile2.pngfile4.png

 

I had tried to create a flow base on some examples that I found. however, I can´t filter the result, and can't choose the second filter.

 

thank you in advance,

best regards

Rui

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Kamacete ,

 

It seems that works fine on my side.

@or(contains(item()?['Status'], 'Info requested'),contains(item()?['Status'], 'Need info'))

vyujincuimsft_0-1654656175673.png

vyujincuimsft_1-1654656243535.png

Result Screenshot:

vyujincuimsft_2-1654656418018.png

 

 

Best Regards,

Charlie Choi

View solution in original post

11 REPLIES 11
MarvinBangert
Most Valuable Professional
Most Valuable Professional

Hi @Kamacete 

are there any relations between sheet1, sheet2 and sheet3? Or do you just need to go through all sheets, only get the items where the status is "go", "check" or "Validate"? Also, I don't really get the value things, why do you need to filter it, if you are no matter what value it is, need to get the email address and send an email?

 

Here is my first thought, hopefully I got your right:

Use the excel action "List rows present in a table" and already apply the filter within the "Filter query" section to only get items in status "go", "check" or "validate". Do this for all three tables (you can use the "get tables" excel action with an "apply to each" around the "List rows present in a table") and add the result to an array variable within your flow (append to array variable). That will give you a complete array from all three sheets. I don't understand what your "group" is, that you want to put into the email, maybe you need to use some "Filter array" actions on your whole array variable to only get the items you want. Of course you also need to select the email address list (I guess the list will be unique in production, you should look for only having unique information in there).

Also: When you have multiple actions executed every time for the same row or sheet, you could consider using a solution and child flows, that will get triggered with some information from the parent flow, does the job and sends back the information instead of building huge "apply to each" runs.

 

Does this help you? Otherwise please give me some more information.

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

Hi Marvin,

Thank very much for you reply.

 

The sheets are not related, but I have to go through all sheets to get the information and send one email by sheet (I can use the same email to send all sheets, just have to add a new column with the sheet name).

 

I need to filter, because I just what to send 3 of 6 stages, I leave a example below for a better understanding. this is my blocking point for now, when I run the flow, I received one email by status.

 

[Excel by sheet:]

2.png

 

[Email to be send:]

2022-06-03 08_32_53-Window.png

Emails address to be use or emails groups:

for each email I need to put the "Owner" on to: and others emails on CC, those (CC: emails) are not in the sheet, or don't have tasks pending, that why I thought in add a new sheet with that information. but maybe I have a easy way to do it.

 

in the end of the email I need just one more think. I need to upload the "Status" with a new status, in this particular case, I have to change from "new" for "info requested".

 

I will tried to recover the flow that I had created based on an examples that I found and post here to show you what I have (I didn't post because I changed and the flow stop to work).

 

I do not know if I pass the all picture, and I appreciate you help.

thank you very much

Rui

 

MarvinBangert
Most Valuable Professional
Most Valuable Professional

Hi @Kamacete 

I guess I got you in most cases, please correct me if I got something wrong:

You could start by using the "List rows present in a table" for all three sheets to get the information. Try to filter it within this action using the Filter Query to only get the information you need within the email. Afterwards you could use the "Filter array" action to filter the sheet content into different smaller arrays/tables. Using "Create HTML table" you can generate the table from the smaller arrays, you can use this html tables within your email.

To get all the email addresses from the other list, you can create a string variable at the beginning of your flow, use an "apply to each", run through the array with the information in it (in best case it's filtered by the emails you need using the "Filter Query" within the Excel action or using the "filter array" action. Then use the "apply to each" to add each email to the string variable with an ";" at the end of each email. This will generate a long string of all addresses you can use within your "Send an email" and this shouldn't generate multiple emails for the same content (only for each sheet).

 

I didn't test it completely; I would need to rebuild this scenario. Maybe this already helps you, otherwise let me know and I will try to build something similar.

 


Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

MarvinBangert
Most Valuable Professional
Most Valuable Professional

Hi @Kamacete 

I guess I got you in most cases, please correct me if I got something wrong:

You could start by using the "List rows present in a table" for all three sheets to get the information. Try to filter it within this action using the Filter Query to only get the information you need within the email. Afterwards you could use the "Filter array" action to filter the sheet content into different smaller arrays/tables. Using "Create HTML table" you can generate the table from the smaller arrays, you can use this html tables within your email.

To get all the email addresses from the other list, you can create a string variable at the beginning of your flow, use an "apply to each", run through the array with the information in it (in best case it's filtered by the emails you need using the "Filter Query" within the Excel action or using the "filter array" action. Then use the "apply to each" to add each email to the string variable with an ";" at the end of each email. This will generate a long string of all addresses you can use within your "Send an email" and this shouldn't generate multiple emails for the same content (only for each sheet).

 

I didn't test it completely; I would need to rebuild this scenario. Maybe this already helps you, otherwise let me know and I will try to build something similar.

 


Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

Hi Marvin, 

Thank you once more.

How can I send to you the flow that I have?

it's to long to put in where.

Let see if I can show what I have do in here.

🙂

 

1.png2.png3.png4.png5.png6.png7.png8.png

 

thank you

Rui

Hi,

I'm

trying to apply more than one option on the filter, but without success.

this is what I have.

 

5ff2466a-785e-4d09-bac4-e14eabd81798.png

 

I will have to apply another filter for another column, can some one help me it this?

thank you in advance

 

Rui

Hi @Kamacete ,

 

As we know we cannot use 'AND' and 'OR' operator in the filter query(List rows present in a table Action). In filter query, it only supports single 'eq', 'ne', 'contains', 'startswith' or 'endswith'. So we cannot create multiple filter queries in Power Automate list rows present in a table.

 

Maybe you could consider adding a Filter array Action.

@or(contains(item()?['Status'], 'Info requested'),contains(item()?['Status'], 'LT requested'))

 

Here are some links that might help you:

https://powerusers.microsoft.com/t5/Building-Flows/Filter-Query-to-show-last-month/m-p/1548939#M1732...

 

https://powerusers.microsoft.com/t5/Building-Flows/Multiple-Filters-on-List-Rows-Present-in-a-table-...

 

Best Regards,
Charlie Choi

Hi v-yujincui-msft

thank you very much for your help. but it doesn't work.

😞

 

1.png2.png

Could you please help me?

Thank you

Br,

Rui

Hi @Kamacete ,

 

It seems that works fine on my side.

@or(contains(item()?['Status'], 'Info requested'),contains(item()?['Status'], 'Need info'))

vyujincuimsft_0-1654656175673.png

vyujincuimsft_1-1654656243535.png

Result Screenshot:

vyujincuimsft_2-1654656418018.png

 

 

Best Regards,

Charlie Choi

Thank you very much v-yujincui-msft,

it's working fine the filter

best regards

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages