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

Group files and attach them to an email

Hi, 

This question is kind of related to my previous one but it goes beyond that. 

https://powerusers.microsoft.com/t5/General-Flow-Discussion/Multi-attachment-email-Error/m-p/369393/...

The issue or question that I have is now the following. 

Let's say we have a list of documents on Sharepoint. 

File 1: ABC-001

File 2: ABC-009

File 3: ABC-095

File 4: DEF-077

File 5: DEF-098

The first 3 letters denote the customer to which I would like to send the email with the attached files. 

So, in my case, I would like to send 2 emails.

Email 1 to customer ABC and Email 2 to customer DEF. 

The emails should of course only have the respective files attached. 

Is such a grouping/selection of the files and attachment to an email feasible?

Best regards, 

Ludwig

3 REPLIES 3
ScottShearer
Super User
Super User

@lreinhard7 

Can you provide a little more detail.  For example, do you have a list of the file name prefixes you are looking for?  Is there a list somewhere of who the emails should go to for each type of file?  How many types of files will there be?  In SharePoint?  With that info, this is pretty straight forward.

 

Let me know and I'll provide an example.

 

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

Scott
RezaDorrani
Dual Super User
Dual Super User

Hi @lreinhard7 

 

I built this specifically for your use case

https://github.com/rdorrani/Microsoft-Flow/blob/master/SharePointfilescategorizebyCustomerandsendema...

 

This is how my SP list looks like - so I send emails to the EmailTo column 

You can modify the Flow based on your use case

Capture.PNG

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hello Scott, 

Many thanks for your feedback. 

The files look always the same (below is a screenshot form our demo/test system)

1st element: Customer ID (e.g. DE-015, DE-016, etc.)

2nd element: @ symbol to separate customer ID and invoice number

3rd element: invoice number (e.g. FTI-000066)

Note that there are always 2 files; the first one is the XML with the invoice information, the second one is the PDF. 

Aim:

I try to attach all XML and PDF documents for a specific customer into a single email and send it to them. 

sp.png

 

 

 

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,410)