Form Library is a type of document library that has InfoPath Form as a document
template:
We will create a Form Library called Incidents Forms and will use InfoPath Designer 2010 to design form template for Incident.
2.1.1.1. Start InfoPath Designer 2010 and select New -> SharePoint Form Library in available form templates (Popular Form Templates). Then click Design Form button.
2.1.1.2. Add necessary main data source fields:
2.1.1.2.1. In regard to BUManager (Business Unit Manager) and OperationsManager - we
are going to use those people further in the workflow so we used a Person/Group
Picker control from Controls tab on the ribbon to create those data source
fields:
2.1.1.2.2. When we add this control to the form InfoPath creates a field group
for us:
2.1.1.2.3. We will rename it to whatever we need:
2.1.1.2.4. Will do the same for other people in our form (in this scenario
Operations Manager).
2.1.1.3. Add extra data connections
In our scenario we will use some additional information, like Incident Source Types and Incident Types. We will store this data in SharePoint lists so users can easily create new or edit existing when necessary.
With browser-enabled forms we have to create a Data Connection for the form and a data connection file and store it in SharePoint in order to access external data on the form.
2.1.1.3.1. Create a new Data Connection
2.1.1.3.1.1.
On the Data tab select Data Connections button:
2.1.1.3.1.2.
Then press Add to add new connection:
2.1.1.3.1.3.
Check "Receive data" check box and then press Next
2.1.1.3.1.4.
Select a "SharePoint library or list" option and press Next

2.1.1.3.1.5.
Specify the SharePoint site where this data sits:
2.1.1.3.1.6.
Select a list (Incident Source Types in our case):
2.1.1.3.1.7.
Select necessary columns:
2.1.1.3.1.8.
We don't want to store a copy of the data in the form template so we just leave
the checkbox blank and click Next:
2.1.1.3.1.9.
Finish the data source creation:
2.1.1.3.2. Do the same for any extra data sources that you require. In our case
we will also add Incident Types.
2.1.1.3.3. After we added all data connections, we have to create connection
files (UDCX files) to store connection details and to be able to use our data
connections in browser-enabled forms that we try to build. If we don't use UDCX
files then our forms will not work.
So we have to convert all our data connections to the UDCX files and store them
on the SharePoint site in a Data Connection Library.
2.1.1.3.3.1. First we have to create the document library of type Data
Connection library on the SharePoint site where we will store incidents, run
workflows etc.
So from the Site Actions or from View All Site Content we will create a Data
Connection library called Data Connections:
2.1.1.3.3.2. Return to the InfoPath Designer, go to the Data Connections dialog, select the data connection you want to convert
and press "Convert to Connection File..." button:
2.1.1.3.3.3. Provide the URL of the data connection library we created before and then add the connection file name so you could find this connection file later by name.
In our case the URL we have to provide is "http://site_URL/Data%20Connections/Incident Source Types.udcx":
2.1.1.3.3.4. Do the same for all other data connections.
2.1.1.3.3.5. Go back to Data Connections library, locate the newly created connection file(s) and approve them, because otherwise you will only be able to use those data connections if you have full control on the site:
2.1.1.4. Design form views
When the form is getting too complex in terms of amount of data that we have to
display and/or implementing a workflow activities within the form, we need to
split the form into several views.
That would allow us to set up different data representations for different
stages of the form lifecycle and for different viewers.
2.1.1.4.1. Initial Incident View
This view will be the default one when we create a new incident in our system.
We will display only the information that is necessary for submitting an
incident and display the rest in other view(s).
2.1.1.4.2. To create additional view go to Page Design tab and click New View
button:
2.1.1.4.3. In our case we wanted to create an additional view for BU Manager. This view would serve as a snapshot of the initial incident data which mostly shouldn't be changed during the process, but only allow to change Severity if required, provide Investigation Comments and select an Operations Manager:
By implementing additional view we simplify the process and give opportunity for users to review data that has been initially provided and only add necessary bits on the next steps within the process.
For example, in our case we don't have to create an additional task for Business Unit Managers to complete with separate task record and separate task form, but we can just send a link to the created incident and Business Unit Managers will be able perform their activities with the same form.
2.1.1.4.4. Add and design extra views if required. In our case that might be an Operations Manager view.
2.1.1.5. Create Rules
InfoPath Designer 2010 includes very powerful rules manager. Rules are activities that allow us to implement business logic on the form. For example, validation of different sorts, formatting and actions based on some conditions or not.
In our case we need two simple rules:
- On form load we need to switch the view based on current Incident Status
- If Severity is high (Severity equals 1 or 2) then we display the Operations Manager selector for Business Unit Manager, otherwise hide the selector
2.1.1.5.1. Create a rule that works when form loads
2.1.1.5.1.1. Go to the Data tab and select Form Load button in Rules section:
2.1.1.5.1.2. In the New menu on the Rules Manager window select Action item:
2.1.1.5.1.3. We add a condition to this rule:
2.1.1.5.1.4. If Status = "BU":
2.1.1.5.1.5. We need to change the view to BU Manager View. So we add Switch Views action:
2.1.1.5.1.6. Specify the necessary view that we need to switch to if our condition is met on form load:
2.1.1.5.1.7. First rule has been created:
2.1.1.5.2. Rule for the form field value
2.1.1.5.2.1. Select a section of the form that will be affected by the new rule. In our case it is Operations Manager picker section:
2.1.1.5.2.2. Then on the ribbon select Manage Rules:
2.1.1.5.2.3. In the Rules Manager window that will appear, select New -> Formatting item from the menu:
2.1.1.5.2.4. Add condition. In our case we will hide this section if Severity is 3 or 4 or 5:
2.1.1.5.2.5. In the Formatting section check "Hide this control" and we are done with this rule:
2.1.1.5.3. We can add more rules if we like and InfoPath Designer 2010 gives us a very good Rules Manager. If we select a form field or control and then click on Add Rule button on the ribbon we will see the options to create a rule from pre-defined templates:
2.1.1.5.3.1. Available templates are context related so if we select a field of different type it will show us the rule templates that are available for selected field's type. For example, we want to validate Incident Date and it shouldn't be in the future. So we select the Incident Date field and when we press Add Rule button in the ribbon we are able to select from templates that are built for DateTime data fields. So we select the necessary one and it's created in just a click of a button:
2.1.1.5.3.2. Here's the rule we have just created:
2.1.1.6. Specify form submit method
2.1.1.6.1. Select Submit Options button in the File menu:
2.1.1.6.2. Select
"Allow users to submit the form" checkbox, "Send form data to a single
destination" radio buttion and then select SharePoint document library as a
destination. Then click Add for new submit data connection:
2.1.1.6.3. Provide the SharePoint form library URL and specify the file name for the form when it will be saved to that library:
2.1.1.6.4. Give the connection a name and then finish the process:
After we have designed the form template we need to publish it in order to use. We can publish the form template using three methods:
- Form Library - to a specified form library where data fields will be promoted to metadata columns and document template for this form library will be the InfoPath Form
- Site Content Type - form will be published as a content type where data fields will be promoted as Site Columns and document template for this content type will be the InfoPath Form
- Administrator-approved form template - form template will be prepared for publishing and then must be imported into SharePoint Central Administration for administrators to activate it on certain Site Collections
Form Library option is a basic publishing and is very straightforward, though you will need to publish this form again and again to other similar form libraries if you need to use the same metadata and form template on the other site or in different form library within the same site.
Site Content Type option is more robust, because it allows us to use the same form template and the same set of metadata across the site collection and other site collections if we use Content Type Hub for example. It will require a couple of extra steps to set up after publishing, but it saves time for the future.
Administrator-approved option is the most complex of all three and results are similar to Site Content Type publishing, but require administrative activities to be performed after publishing. Also if your form template contains custom code you will only be allowed to use this option. Other two will be disabled.
In our case we will use Site Content Type publishing method, because we don't want to use custom code at this stage, but will require some flexibility after we publish the form, for example using incident form on sub sites or on the other business units' sites.
2.1.2.1. In the File menu select Publish tab and then SharePoint Server button:
2.1.2.2. Enter the SharePoint site URL:
2.1.2.3. Check the checkbox to Enable this form to be filled by using a browser and select Site Content Type option:
2.1.2.4. Select the option to create or update content type when publishing depending on your circumstances. In our case we will create new:
2.1.2.5. Specify the name and description of the content type:
2.1.2.6. Specify the URL of the form templates library and the file name. Normally there is a document library created by default called Form Templates with the URL as http://siteURL/FormServerTemplates. We will use this document library to store our form template and will name it Incident Form.xsn:
2.1.2.7. Now we have to specify what data fileds from the form will be promoted to Form Library metadata. We will press Add button for a new column:
2.1.2.8. Select a data field and choose a name for the Site Column that will be created as a new or choose existing Site Column to use instead:
2.1.2.9. For columns of type Person or Group in SharePoint there is no analog in InfoPath when you design a form template from scratch. So you cannot directly link your form data column to the SharePoint column of type Person. You can only link one of the data columns representing user in InfoPath to Single line of text column in SharePoint:
2.1.2.10. So when we add all the necessary columns we hit Next and Publish the form template:
2.1.2.11. If we now follow the "Manage this Content Type..." link we will see the details of the Site Content Type that InfoPath Designer created for us:
2.1.2.12. We can't properly use our form template yet, because we have to add the content type we have just created to the Form Library that we will use to submit and store our forms. So in Form Library Settings allow management of content types if you haven't done that yet and add the newly created Site Content Type. In our case it's Incident Form. It will be available under Microsoft InfoPath group:
2.1.2.13. Now we can create a new Incident Form:
This is the first approach we tried in using InfoPath for building business forms for SharePoint 2010. We will overview the benefits and limitations that we faced or will face if we go this path in our scenario.
2.1.3.1. Benefits
Ater we have created the form and published it to the form library we need to understand what are the benefits of using InfoPath in that scenario
2.1.3.1.1. Relatively easy to create and publish functionaly rich browser-enabled forms for using in SharePoint.
2.1.3.1.2. This type of forms - SharePoint Form Library - is very good option if we think about extensibility. We can write custom code to extend the logic if we don't have enough tools in just out-of-the-box InfoPath Designer. This advantage is very valuable when we try to use InfoPath forms in integration with SharePoint and external systems.
2.1.3.1.3. Powerful Rules Manager that allows to implement almost any business logic in regard to validation, formating and working with the form data
2.1.3.2. Limitations
Though InfoPath is a very powerful tool to design business forms there are some limitations that we have to think about when choosing the Form Library template as our form implementation.
2.1.3.2.1. Not all SharePoint column types are supported by Form Library. For example, columns of type Person or Group. We cannot create column of this type when we publish the form and we can't pass the person value into SharePoint without using custom code.
For our case it's very important, because we want to use information about BU Manager and Operations Manager during the workflow, but we can't use just InfoPath Designer 2010 to accomplish this.
2.1.3.2.2. Form attachments will not be indexed by a Search Crawler. For example, if we were to attach an extra document to support incident evidence then this document will be stored within the form as encoded data and we will not be able to search for this document as we could for Custom Lists attachments.