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)
Any help would be appreciated
Solved! Go to Solution.
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.
Best regards,
Mabel
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!
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.
Best regards,
Mabel
Thats fantastic
Thank you very much. It works perfectly
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
Thanks for your reply
Unfortunatley I dont have an option for DisplayName in the Dynamic Content
Do I need to "Get" more details (properties) from the step below (Get Attachement 2) first?