Introduction to designing a form in InfoPath 2010
InfoPath offers options to enable you to create forms for collecting information from users or displaying information from a data source. This article takes you through the steps necessary to get started, design, setup, and publish an InfoPath form.
In this article
Plan a form template
Before designing an InfoPath form it is important to plan the form design. For example, think about the following scenarios:
Will your form template have one view (page) or multiple views?
Have you planned out what data needs to collected or displayed?
Will any parts of your form template need to be read-only?
Plan where the individual controls will be positioned and how you want the form template to look and function. While you can always change the form template after you have started working on it, it is always more efficient to begin with a design in mind.
Select a template
The first thing to do when you design an InfoPath form template is to choose a template type. When you open InfoPath 2010, a gallery of templates appear on the File tab, that are grouped into four categories — Popular Form Templates, Advanced Form Templates, InfoPath 2007 Form Templates, and Template Parts. The type of template to select depends on both how the form template will be used and what kind of data sources it might connect to.
For more information on form template types, see Overview of form templates and modes.
Select the visual layout of a form template
After selecting a template, you can either customize or continue with the default layout. When you customize the layout, you choose a page layout template, followed by customizing the look and feel of the form by adding custom or pre-defined table styles, and then applying a theme to the form template.
For more information regarding laying out a form template, see Lay out a form template.
Add connections to submit or receive data from other sources
A data connection is a dynamic link between a Microsoft InfoPath form and an external data source, such as SharePoint, a Web service, or a database that is used to receive or submit data. External data sources can be used to make sure that a form is always up-to-date — any changes made to the external data source are automatically reflected in the InfoPath form. A submit data connection enables you to specify where the form data is submitted.
For more information regarding external data connections, see Data connections overview.
Add fields and controls
In InfoPath, fields and controls are not the same thing. Fields are displayed in the Fields task pane and represent the data that is gathered by the form. This data is saved as XML and can be sent to various destinations. In contrast, controls do not contain the data itself; controls are a window into the data that the form gathers. Controls provide a way for the user to enter the data in a way that makes the most sense for the type of information being gathered.
For example, if you want to collect the name of a project and its status in a project tracking form, both fields could be saved as text. You may want to allow the user to enter any string of text as a project name, but require the user to select the status from a list of options. To do this, use a text box control for the project name field and a drop-down list box for the status field.
For more information regarding fields and controls, see Introduction to controls.
Add another view to a form
Views (or pages) are a way to organize a form into different parts that you want to present separately. These parts can be displayed either in a particular order, to particular people, or for a specific purpose. For example, with a status report form, you can set up a second view to track the history of status changes. This view can then be used to make sure that the projects tracked in the status report are meeting deadlines.
For more information regarding adding views to a form, see Add, delete, and switch views (pages) in a form.
Rules allow you to control the behavior of a form by performing such actions as automatically displaying a message inside of a dialog box, setting a field value, querying or submitting to a data connection, switching views, or opening or closing a form in response to certain events and conditions. The events can include a change to a particular field in the form, clicking a button, inserting a repeating section or row in a repeating table, or opening or submitting a form. The conditions can include calculations, user roles, and whether the value of a field is blank, within a specified range, equals the value of another field, or starts with or contains certain characters.
For more information regarding rules, see Introduction to form rules.
Publish an InfoPath form template
When the form design is complete, you must publish the form template so that users can fill out forms based on that form template. Publishing a form template is not the same as saving a form template. Saving a form template saves it as a file, but does not make it available to users to fill out. The publishing process modifies the form template for distribution by adding the publish location and processing instructions sections so that users can open forms that are based on the form template. The processing instructions allow forms that are based on the form template to automatically update if you make changes to the form template after publishing it.
For more information regarding publishing a form, see Publish a form.
Verify the design of a form
Sometimes, usually when converting an InfoPath Filler form template to a browser-compatible form template, or converting an InfoPath 2010 form template to InfoPath 2007 or 2003 format, you might encounter compatibility issues. Even though the focus in InfoPath is on trying to prevent compatibility problems by limiting the form designer to compatible choices, based on the chosen form template, they can still occur. InfoPath checks for errors when you open a form template, change the compatibility setting on a form template, save or publish a form template, or import an Office document as a form template. If errors are found, InfoPath prompts you to resolve them.
For more information regarding compatibility, see Validate the design of a form.