cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
dbruneau
Level: Powered On

Save email attachment to SharePoint folder based on name

I would like to save email attachments to specific SharePoint folders based on the attachment name matching the SharePoint folder metadata. 

 

The attachments I receive contain a code in the name of the attachment. I want each attachment saved to their corresponding folder in SharePoint based on that code. I'm using a document library with document sets (folders) in SharePoint that contain the matching metadata.

 

Attachment example: 1234 ABCD Name.docx

Sharepoint example: Report ID = 1234

 

I want the attachment to be saved in the folder with the matching "Report ID".

 

Thoughts? Questions?

2 REPLIES 2
Community Support Team
Community Support Team

Re: Save email attachment to SharePoint folder based on name

Hi @dbruneau,

 

Do you want to create folders based on the attachment name?

 

Do all the attachments have the same name format?

 

I have made a simple test on my side and it works fine. Please take it for a reference.

 

The attachment name is formatted as 1234 ABCD Name.docx. A function substring will be used to get the Report Id from the name. The code used in the Folder path is:

substring(items('Apply_to_each')?['Name'],0,4)

 

If the attachments have the same Report Id, they will be saved in the same folder, otherwise, a new folder will be created.

1.PNG

2.PNG

 

Please try it on your side.

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
dbruneau
Level: Powered On

Re: Save email attachment to SharePoint folder based on name

The folders have already been created in advance. The folders have a metadata field called "Report ID".

 

The attachments start with the Report ID and then have a space after. The length of the Report ID can vary. In my example, (1234 ABCD Name.docx) ABCD would be the Report ID.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 89 members 3,330 guests
Please welcome our newest community members: