Thursday 7 March 2013

Submitting an InfoPath 2010 form in a document library saving the form as a file and the data as particular Content Type in Sharepoint 2010

The other day one of our clients requested a massive form, I think I count 500 controls. I have never been a huge fan of InfoPath, mainly because every time I use it, becomes a little bit tricky. The client always wants to go to the extra mille, so you end building a web part and leaving the InfoPath form away.

In this case, I knew that a 500 controls form will take me months to build, so I decided the only way, was InfoPath. The requirements were simple, keep the form, and keep the data, so the client could attach a Business Intelligence process behind the results.

The tricky part for me was to create the connection and the content type for it, but as soon as you know how to do it, it is a piece of cake. Right here we go… a step by step:

  1. Open InfoPath 2010.
  2. Select “SharePoint Form Library->Design Form”.
  3. Design your form.
  4. Publish your form to be sure it is ok.
  5. Go to “File->Publish->Sharepoint Server”.
  6. A Wizard like this will be opened:

    image
  7. Enter the site and the Document Library where the form is kept.
  8. Leave this form as it is and click next.

    image
  9. Now, select “Update the form template in an existing form library”, and select the library where you are keeping the forms.

    image
  10. Now! the funny thing… click on Add and select the fields you want, and click “Next”.image

  11. Click on Finish!

Job done!, now, everytime you submit a new form it will be saved in the “Document Library” as a file (with all the data inside) and it will save the data in the columns, so you can interrogate them from any source.

No comments: