Showing results for 
Search instead for 
Did you mean: 

How to create SharePoint list or library using PnP provisioning template in Microsoft Flow, Azure Logic Apps or PowerApps

This article will show how to create a custom SharePoint list or library using PnP provisioning template. You can use this approach to create lists or libraries of any complexity in SharePoint. For example, you may want to create an employees list with a set of predefined columns for your team. We will do it below.

PnP template is an XML file that contains a description of SharePoint entities (lists, libraries, pages, etc.) that will be created. You can create own XML template for your SharePoint list or library. Then use the Provision PnP template to SharePoint action from Plumsail Actions to apply PnP templates to your SharePoint sites using Microsoft Flow or Azure Logic Apps.

If you are new to Plumsail Actions, follow this getting started instruction.

First of all, we need to create a PnP provisioning template for our list. Let us say we have the employees list:


There are two ways to create a PnP template:

  1. Write a PnP template manually and provision a simple list - It is useful for simple lists without custom views or content types.
  2. Get a PnP template from an existing list and provision a complex list - It is useful for complex lists with content types, views, site columns.

You will find the description of both approaches below. Pick the one that you like more.


Write a PnP template manually and provision a simple list

This approach is useful for creation of simple lists or document libraries without custom content types, site columns, etc.

Please open this link to see example of a template for simple employees list. Let us review what you can change in the template.


<pnp:ListInstance> tag

<pnp:ListInstance> tag represents a list. You can change list title (Title) and list URL (Url). Also, if you want to create a document library, you need to change TemplateType to 101 instead of 100.

You can find all the available template types in the official Microsoft documentation.


<Field> tag

<pnp:Field> tag represents a column in your list. You can add new fields by adding new tags like this:

  <Field ID="{4512a091-1007-4cd9-900b-411f01f2b119}" DisplayName="Manager" Name="Manager" Type="Text"/>
  • DisplayName is a display name of the field.
  • Name is an internal name of the field.
  • Type represents a type of the field. You can find all the available types in this article.
  • ID is a unique ID of the field. You can put here unique GUID or fill it dynamically in your Microsoft Flow. See the example below.


<FieldRef> tag under <ViewFields>

<FieldRef> tag under <ViewFields> represents a field in a list view. If you want to add your new field in the list view, create the <FieldRef>tag for it:

  <FieldRef Name="Manager" />

For more information about tags available in PnP templates review PnP provisioning schema.


Example of Microsoft Flow

Copy and paste your template into Provision PnP template to SharePoint action in your Flow:


You need to replace all values for Field IDs using Microsoft Flow expressions like on the screenshot above. It will ensure that your fields will always have unique IDs.

This approach is useful when you want to create simple SharePoint lists or document libraries. If you have a complex list with many views you may consider another option with creating your template from an existing list using PowerShell. For more information read below.


Get a PnP template from an existing list and provision a complex list

PnP PowerShell allows you to execute various commands for manipulating SharePoint, including grabbing of a template from a SharePoint site.

First of all, you need to install PnP PowerShell. Follow the installation instruction. Then connect to your SharePoint site. Execute the command below and specify your own URL for the site where your Modern page is stored:

Connect-PnPOnline -Url ""

Unfortunately, there are no PnP PowerShell commands for getting a template from a single list. You could execute this command:

Get-PnPProvisioningTemplate -Out "template.xml" -Handlers Lists

But this command creates a template for all lists and libraries on your site. If it is your case, you can use the code above. Otherwise, you need a workaround.

The script below is the workaround. It will help you to get a template from a single list:

$listName = "Employees";
$outputTemplateFileName = "template.xml";
$template = Get-PnPProvisioningTemplate -OutputInstance -Handlers Lists
$listTemplate = $template.Lists | Where-Object { $_.Title -eq $listName }
Save-PnPProvisioningTemplate -InputInstance $template -Out $outputTemplateFileName

This scripts gets a template for a single list. Let's take a closer look:

  • In the first line we specify title of the list. You need to replace "Employees" by the name of your list.
  • In the second line, we specify the location of the output template file. You can change "template.xml" to another path.
  • The rest of the code takes a template for all lists of the site. Then it removes all the lists except the one we need.

Once you executed the script, you will have the template for your specific list or document library.

Note: This script gets a template of a list without external references like content types, site columns, etc. If you need to include them into the template, you need to modify the PowerShell script or do it manually in the XML.

That is all. Now you can save the template file somewhere in your SharePoint and use this file as a template in the Provision PnP template to SharePoint action:


If you haven’t used Plumsail Actions yet, registering an account would be the first step. It is quite easy to get started.

This post was originally published here.


Meet Our Blog Authors
  • Working daily with Microsoft Cloud to deliver the needs of my company, my customers and various Microsoft communities and forums. | Office 365 | Flow | PowerShell | PowerApps | SharePoint |
  • Co-founder of, Office 365 and SharePoint expert. Passionate about design and development of easy to use, convenient and flexible products.
  • Microsoft Business Apps MVP. Owner of ThriveFast, an Office 365 consulting company.
  • 7x Microsoft Business Solutions MVP (CRM)
  • I'm keen in MS technologies, SharePoint, Office 365 and development for them
  • Daniel is a Business Productivity Consultant & Microsoft Business Solutions MVP who is very enthusiastic about all things Office 365, Microsoft Flow, PowerApps, Azure & SharePoint (Online). Since the preview, Daniel has been working with Microsoft Flow and later on with Microsoft PowerApps. That led to him being awarded an MVP Award for Business Solutions. He loves to blog, present and evangelize about improving productivity in the modern workspace with these amazing tools!
  • Michelle is an Office 365 solution architect in Twin Cities, MN. She has been delivering business collaboration solutions for years with her focus on SharePoint and Office 365. Michelle is a recent board member of the Minnesota Office 365 User Group and has been a member of the SharePoint community since 2009. She is a frequent speaker at MNSPUG and SharePoint Saturday and co-chaired the Legal SharePoint User Group for 4 years. Her most frequent projects have involved rolling out a large deployment of Office 365, SharePoint Online intranet, build of a "CHAMPS" Office 365 user adoption program and most recently, SharePoint On-Premise to Online Migration. Michelle is very excited about cloud technology as it is shifting her IT Pro focus to collaboration strategy and technical adoption.
  • I'm a Microsoft Office Servers and Services MVP with a special interest in SharePoint, Office 365, Microsoft Flow, Microsoft Teams and PowerApps. I work at Triad Group Plc (
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor