One question that has come up too many times is how do you create a SharePoint Document Set using Power Automate. Well, there’s a Basic and an Advanced approach, but in this post I will discuss the Basic approach. Ready? Let’s get started!!!
If you don’t have a Document Set content type created, let’s walk through how to create one.
SharePoint
- In your SharePoint site, click on the gear icon on the top right and then click on Site information. Then in the Site Information pane, click on View all site settings.
- Under Web Designer Galleries, click on Site content types. Note: if you don’t see this, you might not have the proper permission level to complete this.
- In the Content type gallery, click on Create content type. Then in the Create content type pane, complete the following info:
- Name
- Category – I select the Use an existing category radio button and then I select Document Set Content Types from the Name drop-down.
- Parent content type – I select Document Set Content Types from the Parent category drop-down and then Document Set from the Content type drop-down.
- Click Create.
- Once the new Document Set content type is created, you will be presented with all its details, including the Content Type ID that you will need later in the flow.
Power Automate
Now that you are done with the necessary work on the SharePoint side, let’s move to create the flow. For this demo, I will use the manual trigger, but you can always use an automated trigger based on your business needs.
- Go to https://flow.microsoft.com
- On the left menu, click on Create and then click on Instant cloud flow.
- In the Build an instant cloud flow screen, enter the name of your flow, select the Manually trigger a flow trigger, and then click on Create.
- In the flow editor, click on + New step. Then search for and select Create new folder.
- In the Create new folder action, select your Site Address, List or Library, and Folder Path. Note: the Folder Path is the name of the new folder the flow will create in the selected list or library.
- Click on + New step. Then search for and select Update file properties.
- In the Update file properties action, select your Site Address and Library Name. To set the ID field, click in it and then select the ID value under Create new folder from the Dynamic content window. And to set the Content type Id, click on the drop-down in the field and select Enter custom value. Copy the Content Type ID that was generated on step 4 above in the SharePoint section and paste it in here.
- Click on Save and then test the flow.
Please give this a try and let me know in the comments section below. Thank you for reading and have a wonderful day đŸ˜€
Photo by Wesley Tingey on Unsplash
Works pretty well. Seems that if folder exist new folder (with suffix) is not created.
Do you have a post for “Advanced approach” ?
LikeLike
Hi Vincent,
I haven’t worked on the Advanced Approach yet. I will try to work on it this week and post it.
Thank you!
LikeLike
You can’t turn a folder into a document set, it just doesn’t work that way i’m afraid.
The resulting “document set” is broken and does not function as a document set. As an example, the icons are incorrect, but there are other more severe issues.
The only current way to do this properly is using the REST API – however it has a number of issues, especially in relation to UNICODE and other special characters in the document set name.
LikeLike
Hi Zylantha,
I have used this approach in several different projects with no issues whatsoever. In the next couple of weeks, I will post an advanced approach for you folks to try. I’d be happy to hear suggestions or if you have a different approach.
Thank you!
LikeLike
We had a discussion a couple of years back about the problems created by fudging it the way you describe here –
https://martinpyman.blogspot.com/2020/10/use-power-automate-to-create-document.html
The valid way is described here –
https://www.benprins.net/2020/07/10/power-automate-creating-and-updating-a-document-set-in-sharepoint/
(including my responses with the issues arising from UNICODE characters in the document set name).
Plumsail Actions provides a better – but paid – way to create document sets, however Plumsail is based in Russia.
LikeLike
Thank you! I will read those post.
LikeLike