cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
b1tz
Helper I
Helper I

Simplifying flow

Hi, I would like some assistance in removing unnecessary steps or simplifying the flow. I'm going to add alot more email recipients with different keywords and dont want it to become unmanagable.

 

The flow basically does this:

1. List files in Onedrive folder

2. Grab files with one or more specific keywords and add as attachment

3. Move the grabbed files to a "Sent" folder

4. Send those files to a unique email-adress

5. If no files with a specific keyword are found, the email should NOT be sent to that person.

 

I think I got the flow working as intended now but I will have to accommodate for hundreds of different combinations of keywords and over 40 different "Send email"s.

 

Issues I had was the email sending several times, so I moved it out of the loop and added "check if appended array contains 1 or more items" to stop sending empty emails. I had to add a condition for checking isFolder as it broke when trying to add folder as an attachment (Sent folder is a sub-folder and is listed as an item when listing files)

 

trigger1.png

trigger2.png

 

 

3 REPLIES 3
Valero
Frequent Visitor

Hey @b1tz,

 

My go to solution would be to have a list with all the Keywords you want to look for. Once you have that, you can List Files with that specific keyword by using OData Filters. 

 

EDIT: About the "Send Email" action. If the recipient/s of the email varies based on the Keyword you are looking for, you could also add the recipients to the list. Example:


Keyword 1Recipient 1
Keyword 2

Recipient 2

Keyword 3Recipient 3 and Recipient 4

 

I'm not sure if that approach fits your needs, but let me know if it does and I could provide you with a more detailed solution for your requirement.

 

Kind Regards,

Valero

Hi, thanks for the tip.

 

The problem is that there are.. alot. I'm not sure I'm ready for automating recipients yet.

 

The reports are pdf, sometimes along with jpgs (with the same keywords). About 30-40 emails are sent each morning at the same time.

 

To get it right I'm using two sets of keywords (Events and Locations). Some recipients want all reports from a specific location, but not all events. Some want all reports about certain events regardless of location. To further complicate it, the CC's are not always the same, but to To: field is mostly just one person or a set group of people matched to a certain combination.

 

So basically:

RecipientLocationEvents
Rec1Loc1

Ev1-Ev4, Ev7-11

Rec2Loc2All events
Rec3All locations (added CCs for Loc5-10)Ev1, Ev2

 

And so on.. About 20 different recipients/combination of recipients recieve almost  95% of the reports. The outliers will have to be manually sent.

 

Edit: And there will have to be separate emails for several reports even if they are to the same person if there are different sets of Ev/Loc combinations. The subject should describe the Ev+Loc (I have Dynamic Filename as subject). Only identical Ev+Loc combination reports can be sent in the same email to the same person.

b1tz
Helper I
Helper I

... How do I get the file content from onedrive matching only the keywords I filtered from the sharepoint list? Seems condition works better then odata here. Do I have to upload all files to the sharepoint list just to fetch them again to the emails?

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,802)