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.

View solution in original post

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,267)