5 Ways to submit an InfoPath form to a SharePoint list

Learn which workarounds are available if you want to submit an InfoPath form to a SharePoint list.

As you may already know, while InfoPath offers functionality to submit InfoPath forms to SharePoint form libraries, it does not offer functionality to submit InfoPath forms to SharePoint lists (unless you are using SharePoint list forms in InfoPath 2010). However, there are a few workarounds available, which allow you to submit an InfoPath form to a SharePoint list.

1. Submit InfoPath form to SharePoint list via the Lists web service

You could use the Lists web service that comes with SharePoint and a CAML batch to add an item to a SharePoint list based on the data that is stored in an InfoPath form.

Advantages:

  • Not many security-related issues.

Disadvantages:

  • Knowledge of CAML required.
  • Knowledge of the methods of the SharePoint Lists web service required.
  • Difficult to troubleshoot.

2. Submit InfoPath form to SharePoint list via a SharePoint Designer workflow

You could use a SharePoint Designer workflow that is invoked to add an item to a SharePoint list whenever an InfoPath form is submitted to a Form Library.

Advantages:

  • Not many security-related issues.
  • No programming skills required to be able to create a SharePoint Designer workflow.

Disadvantages:

  • SharePoint Designer required to build the workflow.
  • You have to promote InfoPath form fields to be able to get to the data stored in the form, but not all types of fields can be promoted (e.g. InfoPath attachments and all of the rows in a repeating table), so you cannot get to all of the data stored in an InfoPath form.
  • You will have to re-create the workflow if you want to associate it with several Form Libraries.

3. Submit InfoPath form to SharePoint list using the SharePoint Object Model

You could write code that makes calls directly into the SharePoint object model to add an item to a SharePoint list from within an InfoPath form.

Advantages:

  • You can get to all of the data stored in an InfoPath form.
  • Total flexibility.

Disadvantages:

  • Programming skills required.
  • Knowledge of the SharePoint object model required.
  • InfoPath takes care of adding an item to a SharePoint list, so you will encounter security-related issues when writing code in InfoPath to access and update SharePoint objects.

4. Submit InfoPath form to SharePoint list using an ItemAdded event handler

You could write code in an ItemAdded event handler in SharePoint to add an item to a SharePoint list whenever an InfoPath form is submitted to a Form Library.

Advantages:

  • You can get to all of the data stored in an InfoPath form.
  • SharePoint takes care of adding an item to a list, so you won’t encounter many security-related issues.
  • Total flexibility.

Disadvantages:

  • Programming skills required.
  • Knowledge of event handlers and Features in SharePoint required.

5. Submit InfoPath form to SharePoint list using a custom Visual Studio workflow

You could write a custom Visual Studio workflow and deploy it to SharePoint to add an item to a SharePoint list whenever an InfoPath form is submitted to a Form Library.

Advantages:

  • You can get to all of the data stored in an InfoPath form.
  • SharePoint takes care of adding an item to a list, so you won’t encounter many security-related issues.
  • Total flexibility.

Disadvantages:

  • Programming skills required.
  • Knowledge of SharePoint and Windows Workflow Foundation programming required.
 
 Subscribe via RSS or Email

Related Posts

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.

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners

InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners

InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010

InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers

InfoPath 2010 Cookbook 4: 101 Code Recipes for VB Developers

InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services