How to… - Nintex · This document contains information on: How to publish a new InfoPath form...
Transcript of How to… - Nintex · This document contains information on: How to publish a new InfoPath form...
Page | 1
How to…
Use the ‘Create an Item’ action with custom InfoPath
form templates.
Background:
When creating an InfoPath form and promoting certain fields, the ‘Create an Item’ action is unable
to correctly create a new XML document based on the InfoPath template. To work around this a new
custom content type must be created which contains a modified version of the XML template source
file.
This document contains information on:
How to publish a new InfoPath form template.
Promote InfoPath form fields so they can be used in Nintex Workflow actions and edited
within SharePoint.
Extract the necessary template file from an InfoPath document and then create/enable a
new custom content type for use with the ‘Create an Item’ action.
Design a workflow which will create a new instance of an InfoPath form using a custom
content type.
Page | 2
Publishing an InfoPath form template:
Design your InfoPath form and save it.
From the top right menu select File then Publish.
Page | 3
Select To a SharePoint server with or without InfoPath Forms Services and click Next.
Enter the location of your SharePoint site and click Next.
Page | 4
Select Document Library and click Next.
Select Create a new document library then click Next.
Page | 5
Enter the name of the new document library and click Next.
To promote fields for use within SharePoint, click Add.
Page | 6
Select the fields you would like to promote (ensure the option ‘Allow users to edit data in this field
by using a datasheet or properties page’ is selected) and click OK.
Example 1:
Example 2:
Page | 7
When all the appropriate fields have been selected for promotion, click Next and then select
Publish.
When the form template has been successfully published click Close to close the Publishing Wizard.
Page | 8
Create a new custom content type based on your InfoPath form.
Firstly, the source files for the InfoPath template are required.
From the top right menu select File then Save as Source Files....
Page | 9
Navigate to the location where the source files were saved and open template.xml in notepad.
Note: you will need to close InfoPath first.
Update href=”manifest.xsf" to href=”http://<Team site url>/<Form Library>/Forms/template.xsn”
where <Team site url> is the URL of the site where the template was published.
Save this edited xml file as a new name and note the location.
E.g.
href=http://ntx-steve/Expense%20Forms/Forms/template.xsn
[Optional] remove the solutionVersion attribute. This will prevent issues if you re-publish the form
later. E.g. remove solutionVersion="1.0.0.7"
Page | 10
The next step is to turn on Content Types.
Navigate to the new document library created when publishing the InfoPath form template.
Select Settings then Form Library Settings.
Select Advanced settings.
Page | 11
Under the Content Types heading ensure Allow management of content types? is set to Yes. Then
click OK.
Click on Form under Content Types to customize the content type.
Page | 12
Select Advanced settings.
Page | 13
Select Upload a new document template: then select Browse.... Navigate to the directory where
the modified template.xml file was saved and select it as the file to upload. Click OK.
Note: If the form structure is changed, you will need to repeat the process of updating the template for the
form content type.
Page | 14
Designing the Workflow:
Now you can create a Nintex Workflow and use the ‘Create an Item’ action to create a new instance
of the form.
Drag on a Create an item action.
Configure it to use the new custom content type.