Deploying Infopath form to a list in a different site in SharePoint

Posted: May 24, 2013 in Custom Form, Infopath
Tags:

You want the default Add/Edit/Display forma of a SharePoint list to be customized using Infopath. Open the list, under the List header in the ribbon, you select Customize  Form option which opens your list form in Infopath designer. You  start editing it and once you do all the changes, publish it to see the changes in the list.

Now you want to deploy the same file to a different list in the same site or a different site. In the Infopath designer, under File menu select publish, you would be able to see the publish URL. You need to change this URL to point to your new list location. But unfortunately you cant do this anyway in the designer. You need to update this URL manually by updating the manifest file of the Infopath form. Below are the steps you need to follow..

  1. Under File menu select Save As option to save the Infopath form. You will be saving a .xsn file(In My case file name is Template.xsn).
  2. Now rename the file from .xsn to .cab(Template.xsn to Template.cab).
  3. Extract the file using winzip to a folder(My folder name is Template).
  4. In the files extracted open the file Manifest.xml.
  5. Search for your current site/list URL and replace it with the new site/list URL.
  6. Now we have the manisfest file updated pointing to the new site, we need to to make a cab file out of the extracted files.
  7. We will be using makecab.exe tool to create the cab file. I need to create a directive file. Below is the content of my ddf file(ddf.txt).

    ;************************************************************
    ; MSDN Sample Source Code MakeCAB Directive File
    ;************************************************************
    .OPTION EXPLICIT.Set CabinetNameTemplate=NewTemplate.XSN

    ;*****************************************************************
    ; Change DiskDirectoryTemplate to where you want the CAB/XSN saved.
    ;*****************************************************************

    .set DiskDirectoryTemplate=”C:\Users\chanakya.jayabalan\Desktop”
    .Set Cabinet=on
    .Set Compress=on

    ;*************************************************
    ; List all the files to add to the cab/xsn
    ;*************************************************

    “C:\Users\chanakya.jayabalan\Desktop\Template\Choices Data Connection.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\choices.xml”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Client Assurance.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Client Assurance1.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Client Assurance2.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Client Assurance3.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Client Assurance4.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Concepts, Programs, Projects and Initiatives.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Concepts, Programs, Projects and Initiatives1.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Concepts, Programs, Projects and Initiatives2.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Concepts, Programs, Projects and Initiatives3.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Concepts, Programs, Projects and Initiatives4.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\manifest.xsf”
    “C:\Users\chanakya.jayabalan\Desktop\Template\NewItem.xsl”
    “C:\Users\chanakya.jayabalan\Desktop\Template\SA Team.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\SA Team1.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\SA Team2.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\SA Team3.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\SA Team4.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\sampledata.xml”
    “C:\Users\chanakya.jayabalan\Desktop\Template\schema.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\schema1.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\schema2.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\schema3.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\schema4.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\template.xml”
    “C:\Users\chanakya.jayabalan\Desktop\Template\upgrade.xsl”
    “C:\Users\chanakya.jayabalan\Desktop\Template\view1.xsl”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Week Ending Sorted5.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Week Ending Sorted6.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Week Ending Sorted7.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Week Ending Sorted8.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Week Ending Sorted9.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Week Ending.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Week Ending1.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Week Ending2.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Week Ending3.xsd”
    “C:\Users\chanakya.jayabalan\Desktop\Template\Week Ending4.xsd”

    ;*****************
    ; End Of The File
    ;*****************

  8. Run the command makecab.exe \f  C:\Users\chanakya.jayabalan\Desktop\ddf.txt.
  9. NewTemplate.xsn is the new template file that will be created.
  10. Now right click this file, select design & under File menu select publish. Now you would be able to see the publish URL pointing to your new site/list.
  11. Go ahead and publish the form.
Advertisements
Comments
  1. Jeremy Woods says:

    Great Article! I tried this out and was having some issues, but found the solution. There is one more step that you would need to do if deploying to a list that already exists: Change the ContentTypeID in the Manifest file. I found that by looking here: http://social.msdn.microsoft.com/Forums/en-US/c6f7e1b1-1ea2-466f-b2c6-ce62dcfc918d/sharepoint-2010-using-infopath-2010-recovering-the-previous-form-back-in-action. The very last comment was about the ContentTypeID

    • Candice says:

      Fantastic article. I’ve been looking for this information for a while! Thanks, I would never have been able to figure this out myself! :)))

  2. Thibaut says:

    thanks,
    note that you don’t have to recab, as you can just right click on manifest.xsf and select design 🙂

  3. Alex says:

    Hi,
    I’ve tried it and it doesn’t work for me when I’m trying to publish the new form:
    i’ve got error “list doesn’t exists’.
    i updated all GUID and now i get another error: ‘Object reference not set to an instance of an object.’

    I guess, my problem is that my InfoPath form based on several lists.

    Do you have any idea how can i “republish” my form to other sites?

    Thanks.

  4. Edward Kryez says:

    Hi all, sorry a bit slow, how can you reset a list template from another list template?

  5. […] SharePoint List form using InfoPath Designer 2013. I have followed directions on several blogs (here, here) on exporting the source files and then modifying the manifest.xsf (changing the url path, […]

  6. Kandace says:

    Thanks for you post but I can’t get this to work. Every time I do this, I have noticed that the data connections id’s are changed back to the old(TEST environment) list id’s.

  7. Gary B. says:

    Thanks for your post! I was able to migrate my InfoPath form with a few tweaks to your method.

    Please note that the file that has to be modified is manifest.xsf — not manifest.xml.

    In addition to changing the site URL in this file, you will also need to change the GUID of each list referenced in the InfoPath form so that it matches the value in the target environment. To do that, search for all lines in manifest.xsf with “sharePointListID=” and change the GUID that follows. To determine the GUID value to change it to, simply start SharePoint Designer and navigate to the relevant list in the target environment.

    You may also need to change the GUID value(s) for content types as well. Search through the manifest.xsf file looking for non-null values following “contentTypeID=” and change them to the GUID value in the target environment as well.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s