© 2019 KKiT Co Pty Ltd Terms and Conditions and Privacy Statement

  • Facebook Social Icon
  • LinkedIn Social Icon
  • Twitter Social Icon

News & Updates

Latest from the world of SharePoint & Office 365

  • KKiT for SharePoint

Create a SharePoint Library with Flow

We had the need recently to create a SharePoint Document Library after a item was added to a SharePoint list.


Whilst there is so much you can achieve with Flow out of the box for free there is no way to create a document library.


Third party integrator Plumsail do have a premium pack of SharePoint Flow actions which we highly recommend. The pack comes with over 45 actions to help you get started with Flow and SharePoint.


However for this example we will use out of the box free Microsoft Flow actions. In fact to create a document library it only requires one action: Send an HTTP request to SharePoint.


To get started with this example create a new SharePoint List - for this example we will use the Title field but you could end up using any column you wish.


From the flow menu click Create a flow this will bring up a variety of templates for you to choose from. Click on show more and then select the template When a new item is added in SharePoint, complete a custom action.


This will launch you in to Microsoft Flow and pre-configure the trigger action against your existing list.


The next thing we need to do is search and add the Send an HTTP request to SharePoint action. This action can call any of the SharePoint REST API that your account has access to.

In our example we will be calling the _api/web/lists against the web we require the SharePoint Library to be created.


The below screenshot illustrates the required configuration.


You can copy the JSON code from below directly into the Body of your action:

{'__metadata':{ 'type':'SP.List' },'AllowContentTypes': true, 'BaseTemplate':101, 'ContentTypesEnabled':true, 'Description':"", 'Title': '@{triggerBody()['Title']}'}

You will spot the template ID of 101. This refers to a DocumentLibrary, but you could create different types of list if you wish. This reference guide will provide you with all of the SharePoint list ID's.

Once you have configured the action and saved your flow you can click the Test button. If this is the first time the flow has run it will ask you to perform the action on the target list so go ahead and create a list item. Your flow should be successful and you will have a new Document Library.

7 views