How to Create Workflow History List using PowerShell or using SharePoint Designer 2013

In this SharePoint tutorial, we will discuss how to create a Workflow History list using PowerShell in SharePoint Online. We will check how we can create a workflow history using SharePoint designer 2013.

Just to let you know that we can not create a Workflow History list from the browser in SharePoint. The SharePoint workflow history list is a hidden list.

Even if you save any workflow history list as a template, still it will not appear when you try to create a list. So we have to use either SharePoint designer 2013 or we can also use PowerShell.

Task List and History List are required for creating and deploying a workflow in SharePoint designer 2013 in SharePoint online.

Create Workflow History List using SharePoint designer 2013

One of the best ways to create the Workflow History list is to create through SharePoint designer 2013.

Open the SharePoint online site using SharePoint 2013 designer. Then when you open any existing workflow or when you will create a new workflow, you can see in the Settings section, all the existing Workflow History lists like below.

sharepoint online workflow history list
sharepoint online workflow history list

There is an option to Create a New History List… also like above. Click on “New History List…” option in the above screen.

If there will be any History list presented before then it will show a warning message like below:

Changing the Association, Task, or History list for a workflow may cause the workflow to stop working properly. Before saving the workflow, ensure that list references are still valid.

how to create workflow history list in sharepoint 2013
how to create workflow history list in sharepoint 2013

Click OK. Then it will ask you to confirm “Create new Histroy list?” Click on Yes.

sharepoint 2013 workflow history list missing
sharepoint 2013 workflow history list missing

Just to want to remember one thing is that it will not ask us to give a name for the History list. It will automatically create the Workflow History name in the below naming convention.

<Workflow Name> History

If the name is presented before and you are trying to create another then it will keep adding 1/2/3…

<Workflow Name> History 1
<Workflow Name> History 2
<Workflow Name> History 3

You can see how it will create the Workflow History like below:

Create workflow list using sharepoint designer 2013 SharePoint online
Create workflow list using sharepoint designer 2013 SharePoint online

Create Workflow History List using PowerShell

We can create the Workflow History list using PowerShell. Here we need to provide the list TemplateType as 140.

You can follow this msdn article to know more about list templatetype ids. We need to also make sure, we need to provide a reference to the below dlls.

  • Microsoft.SharePoint.Client.dll
  • Microsoft.SharePoint.Client.Runtime.dll

You can run the PowerShell script using Windows PowerShell ISE or by using visual studio code.

Try{
Add-Type -Path "E:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "E:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
}
catch {
}
$SiteURL = "https://onlysharepoint2013.sharepoint.com/sites/Bhawana/"
$sListName="New Workflow History"
$sListDescription="New Workflow History"
$context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$securePassword=ConvertTo-SecureString "***********" -AsPlainText -Force
$context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials("bijay@onlysharepoint2013.onmicrosoft.com", $securePassword)
$web=$context.Web
$listCreationInformation=New-Object Microsoft.SharePoint.Client.ListCreationInformation
$listCreationInformation.Title=$sListName
$listCreationInformation.TemplateType=140
$list=$web.Lists.Add($listCreationInformation)
$list.Description=$sListDescription
$context.ExecuteQuery()

Once you run the above script, it will create the Workflow History list like below:

create workflow history list sharepoint online powershell
create workflow history list sharepoint online powershell

Read some SharePoint workflow tutorials:

In this tutorial we learned, how to Create Workflow History List using PowerShell or using SharePoint Designer 2013. The same way we can create a workflow history list using PowerShell and SharePoint designer 2013 in SharePoint Online or SharePoint 2013/2016.

>