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

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!



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!



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.

thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 276 members 5,697 guests
Recent signins:
Please welcome our newest community members: