facebook google plus twitter
Webucator's Free SharePoint 2013 Tutorial

Lesson: Forms Library

Welcome to our free SharePoint 2013 tutorial. This tutorial is based on Webucator's SharePoint 2013 End User Training course.

A SharePoint Forms library is a special library designed to store Microsoft InfoPath form documents. Microsoft InfoPath comes with a designer tool for graphically creating forms with a wide assortment of fields and controls. The InfoPath Designer can then be used to publish the forms you design to SharePoint rendering them as web page templates for Forms libraries.

Lesson Goals

  • Learn what a Form Library is.
  • Learn how to create a Form Library.
  • Learn how to use InfoPath Designer to design a basic form template.
  • Learn how to publish an InfoPath Designer form template to a Form Library.
  • Learn how to designate form template fields as library columns.
  • Learn how to create instances of documents in a Form Library.

Creating a Forms Library

You can create a Forms Library just as easy as creating any other library in SharePoint. The following screen capture shows the Forms Library template:

Forms library template

Although it is easy to create a Forms Library using the App template, if you are planning on designing forms with InfoPath Designer, it is usually simpler to create a library as part of the publishing process. One advantage of using the publishing process to create the library is you can choose which fields you want to create library columns for and which fields you only want stored in the XML body of the document item. In a later walk-through and in the lab exercises, you will see how to publish a form template and create a library at the same time.

Creating InfoPath Forms

Create a Form with Microsoft InfoPath Designer

In this walk-through, you will learn how to create a simple form using Microsoft InfoPath Designer.

  1. Launch InfoPath Designer 2013.
  2. Select a template to design an InfoPath form.
    1. Note in the Available Form Templates page that InfoPath loads at startup there are a couple of templates designed specifically for SharePoint. Both of these templates are preformatted with labels and titles.InfoPath Available Templates page
    2. Select the Blank Form template and click the Design Form button to start the process.InfoPath Blank Form and Design Form circled
  3. Add text and fields to the new blank form.
    1. Click the text Click to add title in the form designer window.InfoPath form with Click to add title circled
    2. Type the following text in the title area: Request for Time Off.
    3. Right-click after the text and select the Paint Bucket icon drop-down, and from the drop-down select the Light Green color.Paint icon colors
    4. Click in the region below the dotted line that the title sits above to place your insertion bar in the upper-left corner.InfoPath form with insertion bar circled
    5. Click the Insert tab at the top of the InfoPath Designer window.Insert tab
    6. Click the arrow in the bottom right corner of the tables list to open it. Select the Two Column with Emphasis 4 No Heading option from the list.Insert tab table list
    7. Type the following text Name: in the top left cell of the table you just added.InfoPath form
    8. Type Start Date: in the cell below "Name:" and type Return Date: in the cell below "Start Date:".InfoPath form
    9. With your insertion point in the last row behind the "Return Date:" text, right-click and select the Insert option then select the Rows Below sub option.Insert Row menu
    10. Click inside the left cell of the new row and type the text Reason:; it should be directly below "Return Date:".
    11. Click inside the top right cell with the text Add control currently in it.
    12. Click the Home tab to view its toolbar.home tab
    13. From the Controls list box in the Home tab, click the Text Box control to add it to the selected cell on the form.home tab
    14. Click inside the Add control cell to the right of the "Start Date:" label.
    15. From the Controls list box in the Home tab, click the Date Picker control to add it to the selected cell on the form.home tab
    16. Repeat the previous two steps to add a Date Picker control in the cell next to "Return Date:".
    17. Click inside the last Add control cell to the right of the "Reason:" label.
    18. From the Controls list box in the Home tab, click the Text Box control to add it to the selected cell on the form.home tab
    19. Right-click the first text box control to the right of the "Name:" label and select the Text Box Properties... option from the menu.Control properties menu
    20. On the Data tab of the Text Box Properties dialog window replace "field1" with Name in the Field name field. Click the OK button to save the changes.Control properties dialog
    21. Repeat previous two steps to rename the Date Picker controls, "field2" and "field3", to StartDate and ReturnDate.
    22. Repeat the steps for the "Reason:" text box control renaming it from "field4" to Reason, but in addition to the field name click the Size tab in the Text Box properties dialog window and change the Height property from "auto" to 50 pixels. Click the OK button to save the changes.Control properties menu
    23. The final version of our form should look similar to the following image:InfoPath form

      Leave InfoPath open for the next walk-through that will show you how to publish the form to SharePoint.

Publishing InfoPath Forms to SharePoint

Publish Custom InfoPath Form

This walk-through will show you how to publish the InfoPath form created in the previous walk-through. As part of the publishing process, the walk-through will create a new Forms library with custom library columns. The walk-through will then test the new form by creating a new item in the library.

  1. Publish the custom form using InfoPath Designer.
    1. From within InfoPath Designer, click the Save icon in the upper-left corner of the window above the toolbar.Save Icon
    2. In the Save As dialog window, keep the default location and name the file Time-Off leaving the Save as type set to InfoPath Web Browser Form Template. Click the Save button to complete the processSave As dialog

      InfoPath requires that you save the form before you can publish it.

    3. Click the File tab to get the "Backstage" view of InfoPath Designer.InfoPath Backstage
    4. Click the Publish button on the "Backstage" view of InfoPath Designer. This will take you to the publish options tab. InforPath Publish.
    5. Click the SharePoint Server option on the Publish tab of the "Backstage" view. This will launch the Publishing Wizard InfoPath Backstage
    6. In the Publishing Wizard dialog window, enter your SharePoint site URL, "http://<<your site goes here>>". Click the Next button to continue.Publishing Wizard dialog window
    7. Leave the default values on the second page of the Publishing Wizard. Click the Next button to continue.Publishing Wizard dialog window 2nd page
    8. Leave the default value, Create a new form library selected on the third page of the Publishing Wizard. Click the Next button to continue.Publishing Wizard dialog window 3rd page
    9. In the Name field of the Publishing Wizard's fourth page enter "TimeOff". For the Description field enter "Demo library for requesting time off". Click the Next button to continue.Publishing Wizard dialog
    10. On the next and fifth page of the Publishing Wizard, click the Add button next to the first list box under the heading The fields listed below will be available as columns in SharePoint sites and Outlook folders.Publishing Wizard dialog window 5th page
    11. In the Select a Field or Group dialog window leave the field Name selected with the default settings and click the OK button.InfoPath Select Field or Group dialog window
    12. Repeat the previous two steps to add the fields StartDate and ReturnDate. The final list of columns should look like the following image. Click the Next button to continue.Publishing Wizard dialog window 5th page
    13. Click the Publish button on the sixth page of the Publishing Wizard.Publishing Wizard dialog window final page
    14. Click the Close button on the final page of the Publishing Wizard.
    15. Close InfoPath.
  2. Test the new TimeOff Forms library and your custom form.
    1. Switch back to your browser window and select the Contoso Home Site link in the Top Navigation Bar to refresh the page and the Quick Launch menu so your new library TimeOff shows up on it.
    2. Click the TimeOff link in the Quick Launch menu.Quick Launch menu
    3. Click the new document link in the TimeOff library to create a new item.Add document link
    4. Note how your new custom form opens with the formatting and fields you created. Use the following image as a guide to filling in the form. Click the date icon to get a date picker to choose the dates from.Time Off form
    5. Click the Save button to save the entries to the "TimeOff" form.
    6. In the Save As dialog, enter "Homer" for the File name field and click the Save button.
    7. Click the Close button on the "Time Off" form to close it.
    8. Note the new item in the TimeOff library and the columns, Start Date, Return Date, and Name that were created when you published the form. The "Reason" field data on the form is stored inside the InfoPath item file.Library columns

Creating and Publishing InfoPath Forms

Duration: 15 to 25 minutes.

In this exercise, you will how to create a basic InfoPath form and publish it to a SharePoint site.

  1. Launch InfoPath Designer 2013.
  2. Select a template to design an InfoPath form.
    1. Note in the Available Form Templates page that InfoPath loads at startup that there are a couple of templates designed specifically for SharePoint. Both of these templates are preformatted with labels and titles.InfoPath Available Templates page
    2. Instead of using the preformatted templates, you are going to build a more basic form by selecting the Blank Form template and clicking the Design Form button to start the process.InfoPath Blank Form and Design Form circled
  3. Add text and fields to the new blank form.
    1. Click the text Click to add title in the form designer window.InfoPath form with Click to add title circled
    2. Type the following text in the title area Contact Information.
    3. Click in the region below the dotted line that the title sits above to place your insertion bar in the upper-left corner.InfoPath form with insertion bar circled
    4. Type the following text First Name:, add a space after the ":".
    5. With your insertion point on the same line with text you just typed, click the Text Box control found on the toolbar inside the Controls list box.InfoPath toolbar with Text Box circled

      Note that there are several controls to choose from in the Controls list box. This example is intended to be a simple example so you are only using the Text Box control, but feel free to experiment on your own with other types of controls.

    6. Drag the sizing handle on the right-hand side of the new text box control that you just added until it looks similar to the following image.InfoPath form with Text-Box control sizing handle circled
    7. Click just to the right of the text box control that you just resized to place the insertion point. Type a couple of spaces and then type the following text Last Name:, adding a space after the ":".
    8. Click the Text Box control from the Controls area of the toolbar to add another text box control behind the "Last Name:" text you just entered. Resize the new text box control until your form looks similar to the following image.InfoPath form design view
    9. Click behind the second text box control to place your insertion point and press your Enter key twice to move your insertion point to a new line and add space to line above it.
    10. Follow the previous steps to add text and a text box control for "Email" and "Phone", each on a separate line. Use the following image as a guide to what your form should look like at this point.InfoPath form design view
  4. Edit the properties of the Text Box controls.
    1. Right-click the First Name Text Box control and select Text Box Properties... from the context menu.InfoPath Text Box control context menu
    2. In the Text Box Properties dialog window, rename the Field name: from "field1" to "FirstName". Click the OK button to save your changes.InfoPath Text Box Properties dialog window
    3. Repeat the previous step with each field renaming "field2" to "LastName", "field3" to "Email" and "field4" to "Phone".
  5. Publish the new form to SharePoint.
    1. Click the Save icon in the upper-left corner of the InfoPath window.InfoPath window save icon circled
    2. In the Save As dialog window, name the file ContactForm.xsn and save it somewhere on your computer.
    3. Click the File tab at the top of the InfoPath Designer window.InfoPath toolbar with File circled
    4. Click the Publish button on the Info page.InfoPath Form Information
    5. Click the SharePoint Server button on the Publish page to start the process of publishing to SharePoint.InfoPath Publish page with Publish to SharePoint circled
    6. In the Publishing Wizard dialog window, enter your SharePoint site URL, "http://<<your site goes here>>". Click the Next button to continue.Publishing Wizard dialog window
    7. Leave the default values on the second page of the Publishing Wizard. Click the Next button to continue.Publishing Wizard dialog window 2nd page
    8. Leave the default value, Create a new form library selected on the third page of the Publishing Wizard. Click the Next button to continue.Publishing Wizard dialog window 3rd page
    9. In the Name field of the Publishing Wizard's fourth page enter "ContactFormLibrary". For the Description field enter "Sample library for contacts using InfoPath forms". Click the Next button to continue.Publishing Wizard dialog window 4th page
    10. On the next and fifth page of the Publishing Wizard click the Add button next to the first list box under the heading The fields listed below will be available as columns in SharePoint sites and Outlook folders.Publishing Wizard dialog window 5th page
    11. In the Select a Field or Group dialog window, leave the field FirstName selected with the default settings and click the OK button.InfoPath Select Field or Group dialog window
    12. Repeat the previous two steps to add the fields LastName and Email. The final list of columns should look like the following image. Click the Next button to continue.Publishing Wizard dialog window 5th page
    13. Click the Publish button on the sixth page of the Publishing Wizard.Publishing Wizard dialog window final page
    14. Click the Close button on the final page of the Publishing Wizard.Publishing Wizard dialog window final page
  6. Close Microsoft InfoPath Designer.
  7. Add a new InfoPath document to the library created by Microsoft InfoPath Designer.
    1. Go back to your browser window or open a new one if it is not already open.
    2. Navigate to the site you published the InfoPath form in.
    3. Click on the new ContactsFormLibrary link in the site's Quick Launch menu.Contoso Quick Launch menu
    4. Click the new document link to add a new entry into the library.Contact Form Library Add new document link circled
    5. Note that the form that opens in your browser has the fields and layout you defined in InfoPath Designer.Contact Library New Item form
    6. Enter some data into the fields, for example: "Bart" for the First Name, "Simpson" for the Last Name, "bart@contoso.com" for the Email and "555-1212" for the Phone. Click the Save button when you are done filling in the fields.Contact Library New Item form
    7. In the Save As dialog form, enter "Bart" for the File Name field. Click the Save button to complete the process.
    8. Click the Close button to close the Contact Information form.
    9. Note that the new document named "Bart" has the three columns, First Name, Last Name, and Email in the library view because you selected to add those fields as columns when you published the form. The Phone was not selected to be a column in the library but the data is stored inside the document item.Contact Form Library Columns