To create a document set using MS-Flow use the “Send an HTTP Request to SharePoint”
The Site Address should be the url to the web site that holds the document library.
The Method is “POST”
The Uri is “/_vti_bin/listdata.svc” + “/” + your library name that starts with a capitol letter. (To find or verify the library name cut and paste the following Url into CHROME “https:////_vti_bin_listdata.svc”. This Uri is case sensitive so I recommend the using the previous REST call to verify the Uri)
Headers:
“Accept”: “application/json;odata=verbose”
“Slug”: “https://yourtenant/sites/yourweb/yoursubweb/yourlibrary/yourfilename|ContentTypeForYourDocSet”
I assume you know what yourtenant, yourweb, yoursubweb, yourlibrary and yourfilename are. The content type for your docset (contenttypeforyourdocset) can be found by going to https://yourtenant/sites/yourweb/yourlibrary/ then clicking on library settings, then clicking on the document set content type in the “Content Types” area, and looking at the value of the ctype parameter in the Url. (ctype=0x0120D520006C62DA6A5DD98E44950B3E2593EB9F6D).
In my next post I’ll show the way to get the content type id within the flow by using another rest call and parsing the results.
The following image shows the full call to create a document set called YourFileName in the YourLibraryName library.
Three important notes:
- As indicated above make sure you use the proper library name in the Uri. The library name may not be the one displayed, or the one in the URL, if people have changed the title.
- The Slug should contain the library’s Url. This may be different than the library above.
- The document set conforms to file naming rules, so make sure you don’t use any of the following in the doc set name: ~ ” # % & * : < > ? / \ { | }.
[…] Create a Document Set Using MS-Flow […]