Introduction to InfoPath Forms
InfoPath 2007 is included as part of
Office 2007 (
trail /
test drive) and forms generated by InfoPath 2007 are
great for gathering information from end users. With
Microsoft Office SharePoint Server 2007 Enterprise Edition, you can also use the InfoPath Forms Services capabilities to deliver forms as Microsoft Office Outlook e-mail messages, Web browser forms, or forms for mobile devices. This 2nd part of the
Beginners Guide to SharePoint 2007 Workflow Development, we will be showing you, step-by-step, how to create an InfoPath 2007 Browser-Enabled Form (aka browser-based form) that will gather information from the user. The information gathered in the InfoPath form will help drive the workflow that we will build later in the series.
Workflow Series for Beginners
This series has 6 steps that will help you follow the workflow development process from start to finish.
- Workflow Development Scenario
- Create an InfoPath Web-Based Form
- Preparing your Visual Studio 2008 Workflow Project
- Creating Workflow approval tasks
- Create and Integrate an InfoPath Web-Based workflow task forms
- How to deploy a SharePoint workflow solution
Agenda for Creating an InfoPath Web-Based Form
Here is the step-by-step process we plan on taking in this article:
- Enable InfoPath Forms Services on SharePoint Server
- Create InfoPath browser-enabled form
- Add the Contact Selector to InfoPath 2007
- Design an InfoPath form to gather data from an end user
- Configure Design Checker to check InfoPath 2007 browser-enabled form compatibility
- Publish InfoPath 2007 browser-enabled form to SharePoint 2007 site
- Configure the document library for browser-enabled forms
I hope this breaks down the InfoPath form creation process. Now lets move on to the process, step-by-step.
1. Enable InfoPath Forms Services on SharePoint Server
In order to deploy browser-enabled form templates, you must have enabled and
configured InfoPath Forms Services. You do not need to separately install InfoPath Forms Services because it is installed as a core component of Office SharePoint Server 2007 Enterprise Edition. To configure InfoPath Forms Services, follow these steps:
- Browse to your SharePoint server's Central Administration site
- In the navigation bar, click on Application Management tab
- Under the InfoPath Forms Services section, click Configure InfoPath Form Services
- Within the User Browser-enabled Form Templates section, enable (select check box) the following:
- Allow users to browser-enable form templates - allow users to deploy browser-enabled form templates.
- Render form templates that are browser-enabled by users - allow browser-enabled form templates deployed by users to be rendered in a Web browser
As shown in this screenshot: 
Now that we have enabled
Microsoft Office SharePoint Server 2007 Enterprise Edition to allow end users to open InfoPath browser-enabled forms within a browser, we move on to create and setup InfoPath for browser-enabled forms.
back to top
2. Create InfoPath browser-enabled form
We are now going to create an InfoPath 2007 browser-enabled form that will capture information from a user.
- Launch InfoPath 2007
- Under Design a form section (left side), select
(Design a Form Template)
- In the Design a new template screen, select the following
- Select Form Template
- Select Blank template
- Select Enable browser-compatible features only
As shown in this screenshot: 
This will launch a blank InfoPath 2007 form. One more thing that we have to do is add the Contact Selector control to InfoPath 2007.
back to top
3. Add the Contact Selector to InfoPath 2007
The Contact Selector control is an ActiveX control, included with Microsoft Office SharePoint Server 2007, that enables users to enter and validate contacts against users and groups on a server.
- In the Design Tasks pane, click Controls

- On the Controls pane, click Add or Remove Custom Controls
- In the Add or Remove Custom Controls dialog box, click Add NOTE: The Add Custom Control Wizard appears.
- Under Select a Control Type, select ActiveX Control. Click Next.
- In the list of ActiveX controls, select Contact Selector. Click Next.
- Under Specify Installation Options, select Don't include in a .cab file. Click Next.
- Under Binding property, select value. Click Next.
- For Field or group type, select Field or group (any data type).
- Click Finish
- Click Close
- Click OK in the Add or Remove Custom Controls
The Contact Selector control is listed in the Custom section of the Controls pane.

Now we can create the InfoPath form with the contact selector custom control.
back to top
4. Design an InfoPath form to gather data from an end user
With the above steps completed, we will now go into creating the actual InfoPath form. The scenario as defined in our previous post,
Beginners Guide to SharePoint 2007 Workflow Development - Scenario, starts when an IT employee launches the web-based form and selects the employee who will be part of this workflow. We're going to add in 4 data sources (3 input fields and one submit button) which will allow the IT employee to enter in information that brings in some context to this part of the process of gathering user information.
- Employee Name - this button will use Contact Selector, a custom ActiveX control, to search current site's SharePoint User Profiles and allow the IT employee to select an employee
- Equipment Borrowed - text field to allow the IT employee to enter in what equipment is to be borrowed by the employee
- Office Location - this can be useful to capture so that the IT employee knows where this employee resides
- Submit Button - clicking on the button will submit the information to the document library and close the form.
Let's start with changing the data source name for our form. This is an important step, that every InfoPath form developer should practice. It will save you alot of headaches afterwards.
- In the Design Tasks pane, select Data Source

- Right-click on myFields data source and select Properties
NOTE: The Field or Group Properties dialog box launches.
- Change the name from myFields to InitForm
Lets start with creating a table and enter in the labels for the information we will be collecting:
- Click on the Insert menu
- Select Layout Table...
- Enter in the following information in the Insert Table dialog box
- Number of Columns: 2
- Number of Rows: 4
- In each row, type in "Employee Name", "Equipment Borrowed", "Office Location" and "Submit Form"
This is how the table should look, if you followed the above instructions properly:

Let's add the Contact selector to our data sources.
- Right click on InitForm data source and click on Add...
- Enter in the following information in the Add Field or Group dialog box
- Name: gpContactSelector (case-sensitive)
- Type: Group
- Repeating: Not checked

- Click Ok
- Right click on gpContactSelector data source and click on Add...
- Enter in the following information in the Add Field or Group dialog box
- Name: Person (case-sensitive)
- Type: Group
- Repeating: Checked

- Click Ok
Let's move on and add three text fields under the
gpContactSelector data source: Add
DisplayName text field to the Person group:
- Right click on Person data source and click on Add...
- Enter in the following information in the Add Field or Group dialog box
- Name: DisplayName (case-sensitive)
- Click Ok
Add
AccountId text field to the Person group:
- Right click on Person data source and click on Add...
- Enter in the following information in the Add Field or Group dialog box
- Name: AccountId (case-sensitive)
- Click Ok
Add
AccountType text field to the Person group:
- Right click on Person data source and click on Add...
- Enter in the following information in the Add Field or Group dialog box
- Name: AccountType (case-sensitive)
- Click Ok
This how your data source's should look like:

Drag the
gpContactSelector data source to the column to the right of
Employee Name. You will be presented with a drop down selection, select Contact Selector.

Now you should have the Contact Selector control next to Employee Name:

Let's move on and add two text fields under the
InitForm data source: Add
equipmentBorrowed text field to the
InitForm group:
- Right click on InitForm data source and click on Add...
- Enter in the following information in the Add Field or Group dialog box
- Name: equipmentBorrowed (case-sensitive)
- Click Ok
- Drag equipmentBorrowed
Add
officeLocation text fields to the Person group:
- Right click on InitForm data source and click on Add...
- Enter in the following information in the Add Field or Group dialog box
- Name: officeLocation (case-sensitive)
- Click Ok
You should have the following data sources in your InfoPath form Data source pane:

Now we will drag each data source next to their associated column. Remove the extra text label's that are added when you drag each data source . Your form should look as the following:

Follow these steps to add the Submit button to your form:
- In the Design Tasks pane, select Controls

- Drag the Button control next to the Submit Form column.
- Right click on the button control and select Button Properties...
- Select Submit under the Action drop down
- Select Submit Options... NOTE: This launches the Submit Options dialog box
- Check off Allow users to submit this form
- Select SharePoint document library from the Send form data to a single destination drop down selection list
- Click Add... button right below the drop down NOTE: This launches the Connection Wizard dialog box
- Type in http://litwaredemo/IT%20Requests/Forms/AllItems.aspx for the Document Library NOTE: We have not created the IT Requests Forms library yet but we will be later on in this walkthrough
- Click on the formula
button
- Type in concat("Request for ", ) in the formula text box
- Place your cursor before the closing bracket ) and click on the Insert Field or Group... button NOTE: The Select a Field or Group dialog box launches
- Select DisplayName (under InitForm, gpContactSelector, Person) data source
- Click Ok
- Click Ok NOTE: The Formula text box should read: concat("Request for ", DisplayName)
- Click Next > in the Data Connection Wizard dialog box
- Click Finish
- Click Advanced >>
- Select Close the form in After submit drop down list selection
- Click Ok in the Submit Options dialog box
- Click Ok in the Buttom Properties dialog box
At this point we have created the InfoPath form and now in our next step we will make sure that the form is compatible for
level 1 browsers. This is how your form should look:

back to top
5. Configure Design Checker to check InfoPath 2007 browser-enabled form compatibility
We will also walk you through on how to make sure that your form is browser-enabled using the Design Checker.
- Click on Tools menu and select Form Options
- Select Security and Trust category
- Uncheck Automatically determine security level (recommended)
- Select option Domain (the form can access content from the domain in which it is located)

- Select Compatibility category
- Specify the URL for your SharePoint server (in our example http://litwaredemo)

- Click Ok
At this point InfoPath will connect to your SharePoint server and check the controls that are on your form currently and check if they are compatible. You should see the following screen, to notify you that your form has passed all compatibility checks against your SharePoint site's InfoPath Forms Service.

Now that we have checked compatibility via the Design Checker, we now know for sure that end-users will not have issues with viewing this form in a
level 1 browser (read
cross-browser compatibility improvements) and that InfoPath Forms Services will not have a problem rendering this form for a
level 1 browser. Let's move on to publishing the form to our SharePoint site.
back to top
6. Publish InfoPath 2007 browser-enabled form to SharePoint 2007 site
Publishing the InfoPath form will require running the Publising Wizard, which will help you create the Forms document library and promote fields as document library columns that we can use in our SharePoint workflow. Here are the steps to help you with the final step in this walkthrough:
- Click on the File... menu
- Select Publish...
- Click Ok if you are prompted with the following message:
NOTE: Save the form on your desktop. The Publishing Wizard dialog box will launch
- Select To a SharePoint Server with or without InfoPath Forms Services when asked Where do you want to publish the form template?
- Type in http://litwaredemo in the Enter the location of your SharePoint or InfoPath Forms Services site text box NOTE: At this point InfoPath will check your site to make sure that you have InfoPath Form Services enabled on your SharePoint site
- Click Next >
- Click Next > NOTE: We are accepting the default values. Enable this form to be filled out by using a browser and Document Library is what we want to create or modify.
- In the What do you want to do? prompt, select Create a new document library
- Click Next >
- Type in IT Requests in the Name text field
- Click Next > NOTE: At this point we are in the Property Promotion screen.
- Click on Add...
- Select DisplayName in the Select a Field or Group dialog box
- Change the Column Name to Employee
- Click Ok
- Click on Add...
- Select equipmentBorrowed in the Select a Field or Group dialog box
- Click Ok
- Click on Add...
- Select officeLocation in the Select a Field or Group dialog box
- Click Ok NOTE: You should have the following fields promoted:

- Click Next >
- Click Publish
- Click Close
At this point a new document library (IT Requests) has been created in our site (http://litwaredemo) and you should be able to access it by browsing to
http://litwaredemo/IT%20Requests/Forms/AllItems.aspx Not only have you created and published the InfoPath 2007 browser-enabled form, you have also created a basic document library with the InfoPath browser-enabled form as the main document template. We have also promoted some fields from our InfoPath form, which we will use in our SharePoint workflow. Last but not least we will configure the document library to make sure that the forms are launched in a browser window.
back to top
7. Configure the document library for browser-enabled forms
We have published the InfoPath browser-enabled form but we have not configured the document library to force use of InfoPath Forms Services so that the form is only displayed in our browser window. Follow these steps to force SharePoint to open the form in a browser window:
- Browse to the IT Requests document library (http://litwaredemo/IT%20Requests/Forms/AllItems.aspx)
- Select Forms Library settings under the Settings menu

- Under the General Settings group, click on Advanced Settings
- Check Display as a Web Page in the Browser-enabled Documents section

- Click Ok
Go back to your
IT Requests forms library and click on the
New button. Your form should be loaded by InfoPath Forms Services.

We have created our initial InfoPath browser-based form that will be launched by an employee from the IT department. The IT employee will be able to launch the form, use the contact selector to select an employee, enter in free form text to both Equipment Borrowed and Office Location and then click on Submit. The Submit button will submit the form in to our IT Requests forms library and close the form after completion.
back to top
Next Steps
In our 3rd part of the
Beginners Guide to SharePoint 2007 Workflow Development, we will be preparing your environment for SharePoint Workflow developement before we can get into SharePoint workflow development. If you have not already, please read our
Beginners Guide to SharePoint 2007 Workflow Development - Scenario.
back to top
Additional Resources:
Here are the resources that I used and found useful in my search for SharePoint workflow and InfoPath development:
back to top