Friday, February 7, 2014

SharePoint InfoPath List Form: Move from development to test and production environments

Using InfoPath is a quick way to customize your Sharepoint list forms. But as with most quick solutions is comes with a cost:
Often people will create the InfoPath form on their development or test environment, documenting the process, and then later they will repeat the customization steps on the production environment. And if you use the same form on several lists you have to do the above even more times.
This process takes time, and is error prone. Fortunately there is an easy way to move the forms between lists and environments, and still associate the individual form with the correct list.

When you have completed an InfoPath list form for SharePoint you will typically press the 'Publish' or 'Quick Publish' button. This will publish the form to a specific SharePoint list, with no option to change the publishing path.
What we need to do is change the registrations in the InfoPath form that determines the SharePoint list and content type. This cannot be done in InfoPath Designer, but requires us to edit the form xml by hand. Fortunately the process is not difficult.
The steps are as follows:

  1. Start by opening the customized SharePoint list form in InfoPath Designer.
  2. Go to Files > Publish > Export Source Files, and select or create a folder on your local computer to export the file to.
  3. Close InfoPath Designer to avoid locking of files.
  4. Navigate to the folder and, using Notepad or similar, open the manifest.xsf file.
  5. Find sharePointListID and replace the value with the ID for the new target list. You can get this by going to the settings page of the list, and look at the URL.
  6. Find contentTypeID and replace the value with the ID for the 'same' content type in the new target list. You can find this by going to the content type from the list settings page. If you do not use content types you can temporarily enable management of content types, then disable it after you have the ID.
  7. Find siteURL and replace the value with the path to the new target site. NOTE: If the structures of your development, test and production environments are the same you kan skip this step.
  8. Find relativeListUrl and replace the value with the path to the new target list, relative to it's site. NOTE: If the structures of your development, test and production environments are the same you can skip this step.
  9. Save the file and close Notepad (or whatever editor you use).
  10. Right-click on the manifest.xsf file and select Design to open the form in InfoPath Designer.
  11. Go to Files > Publish, and verify that the form now points to your new list. Then publish the form, and you are done.
If you get an error in InfoPath Designer for specific fields after changing the target list, then you probably have fields with different internal names. In that case you simply reassign the data bindings for the specific fields - InfoPath Designer will give you a listing of the available fields in the new list to choose from.

In a soon-to-come post I will supply a PowerShell script that handles the above, to make it even easier.


  1. Excellent Post. Do you have a PowerShell script which handles the above operation? Thanks

  2. Agreed! Have you developed the PS script yet?

  3. Any update on the PS script?