cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Create folder in SharePoint library

Hi Folks,

 

Is it Possible to create Folder & Sub Folders in SharePoint Library, When an item is created in List.

 

 

Thanks & Regards,

Lakshmi

3 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Create folder in SharePoint library

Hi @lakshmitulasi,

 

Currently there is no available Microsoft Flow Action to create folders or subfolders by default, we could only create file or update file in SharePoint Library.

For Folders, you may take a try with Custom API, use the Folder REST API to manage the folder creation.

Adding some reference:

Start to build with Microsoft Flow

Working with Folders and files with REST

 

And if you would like to have the create Folder action added in Microsoft Flow Action, then please consider submit this as an idea in the Microsoft Flow idea forum.

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

Regards

Community Support Team _ Michael Shao
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

Highlighted
Advocate II
Advocate II

Re: Create folder in SharePoint library

Step 1: When an account is created

image.png

Condtion 1: I check if the account is a customer or prospect. Anything else i dont want the folder to be created. This is probably just for my situation needed 🙂

image.png

Step 2: IF condition 1 is Yes then: Create file in the Document Library of the teamsite, subfolder Verkoop (Sales) and then Another subfolder with the variable Accountname (this folder did not exist and got created with the flow).

Make sure u put the / after the teamsite and do not put another / at the beginnen Folder location. And use the %20 if u just use a space it won`t work.

image.png

Step 3: Its just for me so i get a notification that the folder is created. It sends a mail to a certain e-mail adres.

image.png

Step 4: Delete the file that was created. Just use the root site adres. Without any other links like Shared Folders or something. And i used Id as dynamic parameter to identify the file that must be deleted.

image.png

 

Hope this helps.

View solution in original post

Highlighted
Helper V
Helper V

Re: Create folder in SharePoint library

Hi @arbangara99,

 

Yes, you can do it use year and month when creating a folder.

 

Just use "Current time" action from "Date time" connector to get current time.

 

Then use "formatDateTime" function to format it according to your requirements.

 

More information about Workflow Definition Language functions.

 

How to use expressions in Microsoft Flow.

 

Then use this formatted date as a name of a folder.

 

You can use approaches suggested above or Create Folder action from Plumsail SP connector.

 

Note: Plumsail SP and Plumsail Documents are paid connectors that provide a lot of useful actions. You can find pricing here.

 

View solution in original post

16 REPLIES 16
Highlighted
Community Support
Community Support

Re: Create folder in SharePoint library

Hi @lakshmitulasi,

 

Currently there is no available Microsoft Flow Action to create folders or subfolders by default, we could only create file or update file in SharePoint Library.

For Folders, you may take a try with Custom API, use the Folder REST API to manage the folder creation.

Adding some reference:

Start to build with Microsoft Flow

Working with Folders and files with REST

 

And if you would like to have the create Folder action added in Microsoft Flow Action, then please consider submit this as an idea in the Microsoft Flow idea forum.

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

Regards

Community Support Team _ Michael Shao
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

Highlighted
Advocate II
Advocate II

Re: Create folder in SharePoint library

When creating a file and u specify a path with a folder thats not there, the folders with be automatically created. So it is possible to create folders with Flow.

 

I have a flow that creates a simple readme.txt file in a folder that doesnt exists.

Folder gets created.

After that i delete the file in the same flow.

 

 

Highlighted
Anonymous
Not applicable

Re: Create folder in SharePoint library

Hi Peter,

 

Would you be able to share a screenshot of the action step.

 

For instance what values did you enter in the folder field and what values you entered in the file field?

 

Thanks,

-Venkat

Highlighted
Advocate II
Advocate II

Re: Create folder in SharePoint library

Step 1: When an account is created

image.png

Condtion 1: I check if the account is a customer or prospect. Anything else i dont want the folder to be created. This is probably just for my situation needed 🙂

image.png

Step 2: IF condition 1 is Yes then: Create file in the Document Library of the teamsite, subfolder Verkoop (Sales) and then Another subfolder with the variable Accountname (this folder did not exist and got created with the flow).

Make sure u put the / after the teamsite and do not put another / at the beginnen Folder location. And use the %20 if u just use a space it won`t work.

image.png

Step 3: Its just for me so i get a notification that the folder is created. It sends a mail to a certain e-mail adres.

image.png

Step 4: Delete the file that was created. Just use the root site adres. Without any other links like Shared Folders or something. And i used Id as dynamic parameter to identify the file that must be deleted.

image.png

 

Hope this helps.

View solution in original post

Advocate I
Advocate I

Re: Create folder in SharePoint library

Hi! I just created an Azure Function to do it. You can use a swagger definition in your Microsoft Flow to call it. Read this blog post for more information.

Highlighted
Regular Visitor

Re: Create folder in SharePoint library

Very nice. Exactly what i needed. Thanks

Highlighted
Continued Contributor
Continued Contributor

Re: Create folder in SharePoint library

This was very helpful; thank you.

 

Would you also know how to add an action that would send an email to a user if the filename in the list is edited / changed so they could manually change the matching filename of the folder?

 

Or, if the user deletes the SharePoint item, would it be possible to write a Flow that would cascade that delete to the folder?

Highlighted
Advocate II
Advocate II

Re: Create folder in SharePoint library

Hi Tianaranjo,

 

i currently dont have the time to check this for u. Srry.

Maybe someone else can help.

Highlighted
Helper V
Helper V

Re: Create folder in SharePoint library

Hi,

 

It is now possible with two new actions in our Microsoft Flow Connector called "Plumsail SP". It is a part of Plumsail Actions product and It provides a rich set of actions for SharePoint including:

 

Create SharePoint Folder by URL
Create SharePoint Folder in List

Highlighted
Advocate II
Advocate II

Re: Create folder in SharePoint library

Can you get the newly created folder with the current Month and Year as the folder name?

Highlighted
Helper V
Helper V

Re: Create folder in SharePoint library

Hi @arbangara99,

 

Yes, you can do it use year and month when creating a folder.

 

Just use "Current time" action from "Date time" connector to get current time.

 

Then use "formatDateTime" function to format it according to your requirements.

 

More information about Workflow Definition Language functions.

 

How to use expressions in Microsoft Flow.

 

Then use this formatted date as a name of a folder.

 

You can use approaches suggested above or Create Folder action from Plumsail SP connector.

 

Note: Plumsail SP and Plumsail Documents are paid connectors that provide a lot of useful actions. You can find pricing here.

 

View solution in original post

Highlighted
Advocate II
Advocate II

Re: Create folder in SharePoint library

@anton-khrit, Thank you so much for your valuable guidance. That works for me.

 

Highlighted
Frequent Visitor

Re: Create folder in SharePoint library

This is such a great solution. Thanks for providing it!

Highlighted
Post Patron
Post Patron

Re: Create folder in SharePoint library

@anton-khrit Hi Anton,

I tried your method. It worked for my account.

However, other members cannot create the folder / file in the sharepoint .

The error is "Unauthorized". But I added the members as "Owners" of the sharepoint.

What is the problem?

Highlighted
Advocate IV
Advocate IV

Re: Create folder in SharePoint library

you can now use the create folder action 🙂


@lakshmitulasi wrote:

Hi Folks,

 

Is it Possible to create Folder & Sub Folders in SharePoint Library, When an item is created in List.

 

 

Thanks & Regards,

Lakshmi


 

Highlighted
Regular Visitor

Re: Create folder in SharePoint library

Yes. we can create folders and subfolders in SharePoint library using MS Flow.

Please refer the steps:

  1. Any trigger for MS flow. (I have used button click trigger of PowerApps)
  2. Add Create New Folder action
  3. Set Folder path as per the hierarchy ( WBS10006/ Templates/ Cost)

It creates Parent Folder (WBS10006) à Sub Folder 1 (Templates  inside Parent Folder)à Sub Folder 2 (Cost inside Sub Folder 1)

Example: WBS10006 --> Templates --> Cost

 

 

Please find the result of this in SharePoint Library (example : I have created CHnagreRequest as Document library)

Result.PNG


@lakshmitulasi wrote:

Hi Folks,

 

Is it Possible to create Folder & Sub Folders in SharePoint Library, When an item is created in List.

 

 

Thanks & Regards,

Lakshmi


 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Users online (6,225)