Trick: Create InfoPath forms using a SharePoint Designer workflow
Learn how you can change the settings and default template on a SharePoint Form Library in such a way that it enables you to use a SharePoint Designer workflow to automatically create InfoPath forms in that SharePoint Form Library.
As you may already know, you can use either the Create List Item or the Copy List Item action in a SharePoint Designer workflow to create a SharePoint list item or document.
Create List Item advantages
A Create List Item action has the following advantages over a Copy List Item action:
- Create List Item returns the ID of the new SharePoint list item created, which you can use later on in the workflow to lookup the new item. Copy List Item does not return anything.
- If you use Create List Item, you can set the values of fields on the new SharePoint list item you create. If you use Copy List Item, you cannot set anything.
‘Create List Item’ does not work for InfoPath form templates
Create List Item works great on document libraries that are based on a Word or Excel template. But if you’ve ever tried Create List Item in a SharePoint Designer workflow on a SharePoint Form Library, you’d know that instead of creating a new InfoPath form, it creates a new copy of the InfoPath form template that is set as the default template on the SharePoint Form Library.
The difference is that when you create a SharePoint Document Library with a Word "template", SharePoint actually uses a Word document as the template on the document library, and not a Word template. This is not the case for a SharePoint Form Library where an actual InfoPath form template – and not an InfoPath form (document) – is used as the template on the form library.
So it makes sense that when you use the Create List Item action in SharePoint Designer, a copy of the InfoPath form template is created instead of a copy of an InfoPath form (document).
Workaround for using ‘Create List Item’ to create InfoPath forms
The trick to getting the Create List Item action to create a new InfoPath form in a SharePoint Form Library is to specify an empty InfoPath form as the default template on the SharePoint Form Library. And if you want users to be able to manually create an InfoPath form via the New button menu (in addition to forms automatically being created via a SharePoint Designer workflow), you must enable content types on the SharePoint Form Library.
In the following InfoPath-SharePoint-SharePoint Designer video tutorial, I’ll show you how you can create and deploy an InfoPath form template to a SharePoint Form Library, specify an InfoPath form as the default template on the SharePoint Form Library, and create a SharePoint Designer workflow to create new InfoPath forms in the SharePoint Form Library. Note: You could also deploy an InfoPath form template as a SharePoint site content type and apply a similar trick.
If you already know how to create and publish a browser-compatible InfoPath form template, you can fast-forward the video to the part where I specify an empty InfoPath form as the default template on the SharePoint Form Library; it starts around the 03:00 minute mark.
Note: The process for creating and filling out an InfoPath 2010 form in SharePoint 2010 using SharePoint Designer 2010 works similarly, although there have been some changes made to SharePoint when going from version 2007 to 2010. However, the concept remains the same. You can view a demo video of a working solution here: Create InfoPath form through SharePoint Designer 2010 workflow.
Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.