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

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
Community Support Team
Community Support Team

Re: Email Attachments saved to a new Folder named todays date

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

Re: Email Attachments saved to a new Folder named todays date

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!

Community Support Team
Community Support Team

Re: Email Attachments saved to a new Folder named todays date

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

GiZmO
Level: Powered On

Re: Email Attachments saved to a new Folder named todays date

Thats fantastic

 

Thank you very much. It works perfectly

GiZmO
Level: Powered On

Re: Email Attachments saved to a new Folder named todays date

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

Community Support Team
Community Support Team

Re: Email Attachments saved to a new Folder named todays date

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.
GiZmO
Level: Powered On

Re: Email Attachments saved to a new Folder named todays date

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
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: 345 members 5,412 guests
Please welcome our newest community members: