cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ScottR-MT
Advocate I
Advocate I

Flow to Create Files in Different SharePoint Folders Based on Keywords in Email Attachment Filenames

Hi,

 

As my subject line suggests, I would like to build a flow that will parse emails with multiple attachments (from Office 365 Outlook), and put the attachments into different SharePoint online Library folders, based on when the filenames contain the words Approved or Rejected.


Any ideas?

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
v-yuazh-msft
Community Support
Community Support

Hi @ScottR-MT,

 

I have made a test on my side, please refer to screenshot below to create the flow:

Capture.PNG

Capture.PNG

 

Please make sure you have choose the "Attachments Content" dynamic content of the trigger in the "File Content" field of "Create file" action of sharepoint connector.

And please choose different folder for "Approved" or "Rejected" to save the attachment.

 

 

Best regards,

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
mydevexperience
Helper I
Helper I

Hey,

 

Follow the below instructions:

 

Add "On new email with attachment (webhook)". Next add "Get email"

 

image.png

Next

 

Add apply to each and check condition "Attachment Name" contains "Approved"

 

 image.png

 

Under the Yes and No condition add Create File (SharePoint) control

 

sp1.png

The site address is your SharePoint URL

Folder Path is your Document library name. Set the appropriate folder path for Yes and No condition to move the documents correctly.

 

I have tested this and it is working as expected. 

 

If you have any questions please let me know.

 

If you find it useful then mark it as solution.

 

Thanks

v-yuazh-msft
Community Support
Community Support

Hi @ScottR-MT,

 

I have made a test on my side, please refer to screenshot below to create the flow:

Capture.PNG

Capture.PNG

 

Please make sure you have choose the "Attachments Content" dynamic content of the trigger in the "File Content" field of "Create file" action of sharepoint connector.

And please choose different folder for "Approved" or "Rejected" to save the attachment.

 

 

Best regards,

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Is that worked for you? If it is please accept this as solution to help others.

 

If you need any help please let me know.

 

Thanks

Thank you very much!  Just a couple of further questions...

 

The flow does not add the file extension when creating the files on the SharePoint in this flow.  How can I make the flow get the extension from the attachments automatically?

 

Also, I am adding the "Received Time" dynamic content to the beginning of the filename.  How can I reformat it to show the date as YYYY-MM-DD HH:MM:SS ?  Also, I want the time to be in my timezone.

@ScottR-MT, have  look at this post

 

email attachment file manipulate

 

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,859)