Create a SharePoint Designer workflow for InfoPath forms

Learn how you can create a simple SharePoint Designer 2010 workflow that runs and creates new SharePoint list items whenever InfoPath 2010 forms are saved or submitted to a SharePoint 2010 form library.

You can use SharePoint Designer 2010 to create workflows that run on InfoPath forms stored in SharePoint without having the need to write code. While such workflows have their limitations, you can do astoundingly much with them.

Before you can create a SharePoint Designer workflow that runs on InfoPath forms in a SharePoint form library, you must first create and publish an InfoPath form template to SharePoint. And while publishing the form template, you must promote the fields that you would like the SPD workflow to be able to access.

Once you have a form template and SharePoint form library, you can then create the workflow in SharePoint Designer 2010. In SharePoint Designer 2010, you have the option to create either a List Workflow or a Reusable Workflow to run on forms in the SharePoint form library. To learn more about these two types of workflows, see examples of how to use them, and get guidance on how to create SharePoint Designer workflows for InfoPath forms, see Chapter 5 of InfoPath 2010 Cookbook 2.

The following InfoPath video tutorial explains two essential steps to create a simple SharePoint Designer 2010 workflow that runs on an InfoPath form that is submitted to a SharePoint form library. Those steps include publishing the InfoPath form template on a way that the SharePoint Designer workflow can access data stored in the form, and creating a simple workflow in SharePoint Designer 2010 that reads data from the InfoPath form and uses it to create a new SharePoint list item.

In this InfoPath 2010 tutorial video, you learned...

  • How to publish an InfoPath form template to a SharePoint form library, thereby promoting form fields to the SharePoint form library.
  • Create a List Workflow in SharePoint Designer 2010.
  • Add a Create List Item action to a SharePoint Designer workflow.
  • How to configure a SharePoint Designer workflow to run when an InfoPath form is either saved or submitted to a SharePoint form library.
  • How to publish a SharePoint Designer workflow to SharePoint 2010.
  • How to test a SharePoint Designer workflow that runs on an InfoPath form in SharePoint 2010.

InfoPath 2010 with SharePoint 2010 video transcript

Here I'm in InfoPath Designer 2010, where I've already precreated a simple InfoPath form template that has just one control on it, a text box control called surname. The idea is that I would like to submit this InfoPath form to a SharePoint form library, and then have a SharePoint Designer workflow kick off, grab the InfoPath form, retrieve the data that was stored in this surname field, and then use that data to create a SharePoint list item.

So the first step to create such a solution is to first publish the InfoPath form template to a SharePoint form library, but then publish it in a way that the SharePoint Designer workflow can access the fields in the InfoPath form.

So I'm just going to start the publishing process, and publish it to a SharePoint form library. I'll create a new form library called MyFormLib. And then here is where you can add fields to promote them to the SharePoint form library or the default content type in this case. I'll just select the surname field here and then leave everything as is. These settings will basically create a list column in the SharePoint form library, so that the SharePoint Designer workflow can access it. So once the InfoPath form template has been published to SharePoint, we should see a column here appear in the SharePoint form library, and this column should be accessible by the SharePoint Designer workflow.

So the next step would be to create a SharePoint Designer workflow, so I'll go to SharePoint Designer 2010, and I'll refresh my lists. Once I've refreshed the lists, I'll keep things simple and create a simple list workflow. So I'll go to List Workflow and then select the SharePoint form library to which I published my InfoPath form template. And then I'll call it something simple like MyWF. Click OK.

So the first thing we want to do is add an action that will create a SharePoint list item. So I'll just click Action, and then I'll select form the List Actions group I'll select Create List Item. And I'll create my item in a custom SharePoint list called MyList, which I've already precreated. It doesn't have any columns in it except this Title column. And this Title column is what I'm going to set to the value that will be retrieved from the InfoPath form.

So I'll just click... select this Title field, click Modify, and then here I'll set the value of the title to be equal to the Current Item, which is what the workflow will be running on which is in fact the InfoPath form, and then inside there I'll look for the Surname field, and then I'll click OK. And that is all we should require.

And then I'll configure the workflow to start automatically when an item is created, and I'll leave this check box so that I can also manually start the workflow if I need to. And then I'll hit Publish here, and the workflow should be then ready to be used in SharePoint once it has been published.

So now that the workflow has been published to SharePoint, I'll switch to SharePoint. Here I'm currently logged in as an administrator, so I'll switch to be a different user. Let's say jane.doe. So now I'm logged in as Jane Doe.

And basically what I'm going to do is I'm going to add an InfoPath form to my SharePoint form library, and just enter my name here. And I'll click Save. Give it a name. Once the InfoPath form has been saved, you'll see that the SharePoint Designer workflow has kicked off here; it says In Progress. And then we'll have to wait a while... I'll refresh it. And then here you'll see that it has Completed. So we should be able to go to the MyList custom list and then see that a list item was created.

I can repeat the process... let's take a different user and enter Clovis Carvalho. And I'll save it as form02. And then again you'll see that the workflow ran and completed. And then if I go to the MyList custom list, you'll see that a second SharePoint list item was created.

See more InfoPath 2010 tutorial videos »

 


Related InfoPath Articles:

 

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. 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.

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners

InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013

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