cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
abm
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 blogPower Automate Video Tutorials
abm
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 blogPower Automate Video Tutorials

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (34,169)