SharePoint Pals
 | Sign In
Associating SharePoint 2013 Workflow to a SharePoint Online List and editing the XAML file
by Sriram Varadarajan 19 Jun 2016
Enterprise Architect
Today  :   5     Total  :    3188

Though our major goal is to associate the Work Flow to a SharePoint Online List but the sub set of this would be to edit the XAML file. In this blog, first I will take you through how to edit/open the XAML file and next part would be associating the Work Flow.


 I have developed a Workflow in my Test site and I wanted that workflow to be associated to a different list under a different site, but when I opened my target site using designer I couldn’t find the Workflow folder under All Files. For me to change the association I should be able to edit the XAML file


So, why is that my site missing that folder????

Here are the answers to that question

· 'Workflows' folder under 'All Files' is only for SharePoint 2010 workflows and would be visible if you have SharePoint 2010 workflows in your site

· For SharePoint 2013 workflows, the XAML associations are present in the hidden list 'Wfsvc'

· After I created a 2010 workflow, I was able to see the 'Workflows' folder

How to see the XAML file

Option 1

To see the XAML associations for SharePoint 2013 workflows, unhide the 'wfsvc' library using PS

 $url=""  #URL of the site
 $password=Read-Host -Prompt "Enter Password" -AsSecureString
 $credentials=New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials("USER ID",$password) #user name of an admin account within “”
 $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url)

Try opening the list using OPEN WITH EXPLORER make sure to read this article before you do that

Open the XAML file

Option 2

  1. In SharePoint Designer, go to the workflow whose XAML associations you would like to view
  2. Click on ‘Save as Template’
  3. This would create a .wsp file and save it to the Site Assets library in the site.
  4. Go to the Site Assets library in the browser and download the .wsp file
  5. Change the extension of the file from .wsp to .cab
  6. This would create a zipped file that you can extract and see the contents
  7. The zipped file would contain the workflow.xaml file and other associations
  8. You can view and the xaml file

But these options would still not help you to associate your workflow, here are the options as on today to achieve it.

Using CSOM


 [System.Reflection.Assembly]::LoadFile("C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.WorkflowServices.dll")
 $url="" #URL of the site
 $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url)
 $password=Read-Host -Prompt "Enter your pwd:" -AsSecureString
 $cred=New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials("",$password) #Username
 $listcoll | select Title,id
 $list=$listcoll.GetByTitle("") #Title of the list where the workflow is currently added
 $fields | select title,id
 $wffield=$fields.GetById('') #id of the field that has the workflow name
 $list2=$listcoll.GetById('') #id of the list where you need to move the workflow to
 $wfsm=New-Object Microsoft.SharePoint.Client.WorkflowServices.WorkflowServicesManager($ctx,$web)
 $listsub=$wss.EnumerateSubscriptionsByList('') #list id of the list which has the workflow, $list
 $wf.EventSourceId='' #id of the list where you are moving the workflow to
blog comments powered by Disqus

SharePoint Pals

SharePoint Pals, a community portal for SharePoint developers, Administrators and End Users. Let's join hands and share the point together.
Read this on mobile


Angular Js Training In Chennai
Advanced Angular Js training with real world developer scenarios
Angular Js, Web Api and Ionic for .Net Developers
All in one client side application development for .Net developers
Angular Js For SharePoint Developers
Get ready for the future. Its no more just C#

Get Connected

SharePoint Resources

SharePoint 2013 and 2010 Web Parts
Free Web Parts with Source Code for SharePoint Community

SharePoint 2013 Books and Tutorials
Collection of free SharePoint 2013 books and tutorials (eBooks, pdfs)

Supported By

Contribute your article and be eligible for a one month Free Subscription for Plural Sight. The Author of the most popular New Article (published in the previous month) will be awarded with a Free One month Plural Sight Subscription. Article can be sent to in a word document.

Related Resources

Recent Tweets

Twitter January 15, 00:25
How To Enable Target Value And Actual Value In #D3 Gauge Chart

Twitter January 15, 00:24
How To Open #SharePoint List Hyperlink Column In Modal #Popup Window

Twitter January 15, 00:24
Quick Introduction To #Asp.NetCore And It’s Features

Twitter January 15, 00:22
How To Configure #PerformancePoint Services To Use Secure Store In #SharePoint 2013

Twitter January 15, 00:21
How To Block Or Disable #Office365 Services

Follow us @SharePointPals
Note: For Customization and Configuration, CheckOutRecent Tweets Documentation