cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
lremington
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
Super User

Re: Create a folder based on attachment name

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
Super User
Super User

Re: Create a folder based on attachment name

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

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,870)