Create a Document Set Using MS-Flow

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.
HTTP_Request_to_sharepoint

Three important notes:

  1. 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.
  2. The Slug should contain the library’s Url.  This may be different than the library above.
  3. The document set conforms to file naming rules, so make sure you don’t use any of the following in the doc set name: ~ ” # % & * : < > ? / \ { | }.
Posted in MS-Flow
One comment on “Create a Document Set Using MS-Flow

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: