Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Automatically create new folder in one drive by picking up the subject of email attachment

Whenever a new mail arrives on outlook with an attachment I want that a new folder is created with the name of the subject line.
So I don't have to create a new folder every time when a new mail arrives.

Community Champion
Community Champion

Hey @gauravana3 

There is no direct function in one drive connector to create a new folder. But you can do this when creating a file, you have to give a path to it.

So lets say there is a folder called Documents. Inside that you have to make a folder by your subject name.

You can do the following:


This will create a new folder with the name of your subject value.


Also adding a link to a blog related to this:


Power Automate: Create a folder in OneDrive - Manuel T. Gomes (


I hope this helps.


If this helped you, do accept it as a solution. 



Thank you that solved my one problem.
But suppose I get four types of attachments and in total approx 50 attachments/month. Even If I create 12 folders manually.
Then the problem is I have to create a 4types*12months=48 flows.

Is there anyway you can help me find an easier solution?

Community Champion
Community Champion


Easiest Solution would be to create a single folder and save the files in it.


So, wanted to ask will the subject be similar for many emails? Then those will be saved in that previous folder only. No new folder will be made. Or if the subject has slight differences, before saving the files, you can use a condition to check if that subject related folder is already there in onedrive or not with contains in the condition. 

Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (2,602)