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

Create a folder based on attachment name

I'd like to build a flow that creates a folder based on the naming convention of a file (with conditions): 

 

When an e-mail comes through with an attachment (the attachment could be named 2019-08-30_CEEVENT_FACEBOOK

CREATE A FOLDER that is named YYYY-MM-DD_NAME (excluding the last underscore and text (_FACEBOOK)

Save the attachment in the newly created folder 

 

The goal is for this to be dynamic and a new folder is created everytime I get an attachment with the naming convention.

 

Is this possible? Could someone help me build this flow? 

2 REPLIES 2
Super User III
Super User III

Hi @lremington 

 

Yes your requirement is possible to do via flow. Here are the steps.

 

First step when a new email arrives set the properties 'Has Attachments' and 'Include Attachments' to 'Yes'

 

ze1.png

 

Above the Compose expression to get the folder name is as follows.

first(split(items('Apply_to_each_2')?['Name'], '_FACEBOOK'))
 
Note: Above 'aj' is my SharePoint document library name. 
 
Here are my test results:
 
Flow run history.
ze2.png
 
SharePoint Test Results:
 
Folder created and email attachment copied to new folder.
ze3.png
 
If you need any further help let me know.
 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Super User III
Super User III

Hi @lremington 

 

If the below reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (9,184)