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

Email Attachments saved to a new Folder named todays date

Hi All

I’m trying to create a flow that saves email attachments to a document library in SharePoint.

 

Every day we have 30ish employees sending about 5 photos from their phones to a dedicated email address. Each employee will be working on a construction site for 6 weeks. We currently, Receive Email > Save Attachment to a SharePoint Document Library

 

SharepointFolder\SiteName\EmployeeName\TodaysDate

 

We would like to automate this process if possible. My thoughts are to create a flow for Each Employee that says, "When an email is sent from joeblogs@company.com with attachment. Create a folder in SiteName called TodaysDate (if one doesn’t exist already) and save attachement, calling the file EmployeeName (or email address.. Just something to ID who its come from)." 

 

This way, the only administrative bit we need to do is change the SiteName when the employee moves to the next site.

 

The bit I’m struggling with is the Creating a folder with today’s date and saving the attachment into that folder.

I followed this solution https://powerusers.microsoft.com/t5/Building-Flows/create-new-folder/m-p/117743 but im not sure what my substring should be (if this is the solution for me)

 

Capture.PNG

 

Any help would be appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi @GiZmO ,

 

For you scenario, I guess that there is no need for you to use function substring.

 

If you want to create a folder in a site called Today’sDate/EmployeeName, please check the following flow.

 

The function used in the Compose action is used to generate the folder path:

concat('/Library11/',utcNow('yyyy-MM-dd'),'/',triggerBody()?['From'])

 

Then in the action Create file, select the compose output for the Folder path field.

1.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
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

6 REPLIES 6
Brad_Groux
Super User II
Super User II

Currently, it is not possible to create folders by default with the SharePoint actions. If this is functionality you would like to see added to Flow or a Flow Template, please consider submitting it to the Flow Ideas page, where it can be voted on by other users, and tracked and commented on by the Flow team. 

Please note, that there is an existing idea for Creating Folders in SharePoint. Also, there is a workaround to create folders utilizing the SharePoint REST API, which is covered in this Create a Folder in a document library using Microsoft Flow blog post. For reference, the Working with folders and files with REST documentation.

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!

v-yamao-msft
Community Support
Community Support

Hi @GiZmO ,

 

For you scenario, I guess that there is no need for you to use function substring.

 

If you want to create a folder in a site called Today’sDate/EmployeeName, please check the following flow.

 

The function used in the Compose action is used to generate the folder path:

concat('/Library11/',utcNow('yyyy-MM-dd'),'/',triggerBody()?['From'])

 

Then in the action Create file, select the compose output for the Folder path field.

1.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
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

Thats fantastic

 

Thank you very much. It works perfectly

GiZmO
Frequent Visitor

Hi

 

One more thing

 

concat('/Site/',utcNow('dd-MM-yyyy'),'/',triggerBody()?['From'])

 

Is it possible to change the ['From'] which is creating a folder called EmailAddress to DisplayName instead?

 

Thanks in advance

Hi @GiZmO ,

 

Yes, you just need to replace the dynamic content “From” with “DisplayName”, you can change it to whatever you want, either a static value or a dynamic value.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your reply

 

Unfortunatley I dont have an option for DisplayName in the Dynamic Content

Capture4.PNG

Do I need to "Get" more details (properties) from the step below (Get Attachement 2) first?

Helpful resources

Announcements
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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (61,544)