Life cycle of a form template

This article is for form template designers who want a high-level understanding of the form design process in Microsoft Office InfoPath. It outlines the different phases of creating and deploying a form template, and provides links to more information about key tasks. While you can experiment and work the way that suits you best, following this recommended design process may help save you time and effort in the long run.

In this article


Phase 1: Plan

How much time you spend planning depends on the complexity of your form template, your role in your organization, and on the processes and requirements in your organization.

If your form template will only be used by members of your immediate team, the planning phase may be very informal. If your form template is more complex, the planning phase will likely be a more formal and involved process, and you may need to consult with many stakeholders. For example, if your form template will be one part of a larger, company-wide business system, such as an expense reporting or enterprise resource planning system, then you probably need to create formal planning documents, such as functional specifications.

In either case, before you start designing your form template, you should consider the following:

Top of Page Top of Page

Phase 2: Design

After you've completed the planning phase, you can begin the design process. It is recommended that you follow the order of tasks listed below when designing your form template. However, you can deviate from the order if necessary. For example, you may prefer to define data validation, conditional formatting, and rules for controls as you add those controls to your form template, instead of doing it later in the design process.



Step 1: Create the form template

When you create your form template, you may need to import an existing form, such as a Word document or Excel workbook, into InfoPath or specify compatibility settings for the form template so that resulting forms can be filled out in InfoPath 2003 or in a Web browser. Most of these options are available in the Design a Form Template dialog box. For example, if you want to design a form template that can be opened and filled out in either Microsoft Office InfoPath or a browser, you can select the Enable browser-compatible features only check box in the Design a Form Template dialog box.

The following resources provide additional details about the process of creating a form template.

Click To
Introduction to InfoPath Forms Services Learn about the server technology that enables you to create a form template that can be opened and filled out in a browser.
Introduction to browser-compatible form templates Learn about browser-compatible form templates, which can be opened or filled out in InfoPath, in a browser, or on a mobile device. A browser-compatible form template can be enabled for use in a browser when it is published to a server running InfoPath Forms Services, either by you or by a farm administrator for the server.
Specify the compatibility settings for a form template Choose a compatibility setting for a form template or change the existing compatibility setting. This setting determines which InfoPath features and controls are available to you when designing your form template. For example, if you select the Enable browser-compatible features only check box in the Design a Form Template task pane, InfoPath hides or disables controls and features that won't work in browser-enabled form templates.
Design a form template that works with InfoPath 2003 Create a form template that works in InfoPath 2003 as well as InfoPath 2007.
Upgrade a form template from InfoPath 2003 to InfoPath 2007 Upgrade an existing InfoPath 2003 form template to Office InfoPath 2007 format, so that you can freely use features that are specific to Office InfoPath 2007 in your form template, such as Information Rights Management (IRM).
Convert an Excel workbook to an InfoPath form template Create a form template from an existing Microsoft Office Excel workbook.
Convert a Word document to an InfoPath form template Create a form template from an existing Microsoft Office Word document.

Step 2: Create or specify the main data source

All form templates are based on a data source, which stores the data collected in a form. This data source might be a corporate database, a Web service, or an existing XML file that is used throughout your organization to standardize data, such as an XML Schema (XML Schema: A formal specification, written in XML, that defines the structure of an XML document, including element names and rich data types, which elements can appear in combination, and which attributes are available for each element.) (.xsd) file. If you don't have an existing data source, you can let InfoPath create one for you as you add controls to your form template.

You can view a representation of the data source for your form template in the Data Source task pane:

Part of the Data Source task pane

When you first create your form template, you must decide which of the following approaches to use:

The following resources provide additional details that can help you determine what type of data source to use, and when you should add additional data connections to your form template.

Click To
Introduction to data sources Learn about the data sources that InfoPath can work with, and how they are represented in the Data Source task pane.
Introduction to data connections Learn about data connections, which are dynamic links between a form and a data source that stores or provides data for that form.
Design a form template by using settings in a data connection library Base the design of your form template on a common data connection file that is stored in a data connection library on a Office SharePoint Server 2007 site. This file stores information about a connection to a data source, such as an Access database, a spreadsheet, or a text file.

Step 3: Define layout

Most form templates include at least one layout table, which is a framework for organizing and arranging form content, including controls, sections of a form, logos, and other types of images.

You can find ready-made layout tables in the Layout task pane:

Part of the Layout task pane

The following resources provide additional details about visual design options for your form template.

Click To
Introduction to laying out a form template Learn about layout tables, which help you to line up elements on a form template, and about controls that are used for layout purposes.
Apply a color scheme Learn how to automatically apply coordinated colors to certain items on your form template.
Insert and position a picture Learn how to insert a picture, such as a corporate logo or masthead, into a form template.

Step 4: Add controls

Controls allow users to enter and select data in the form template. They can also be used to display data from existing data sources, such as databases or Web services. After creating your form template's layout, you can insert any control that you need into your form template. The Controls task pane provides access to all of the controls that are available in InfoPath, including any custom controls that have been added to the task pane, such as ActiveX controls (ActiveX control: A custom control. Form designers can add or remove ActiveX controls in the Controls task pane.) or template parts (template part: A portion of a form template that can be saved for reuse in multiple form templates. A typical template part consists of controls and a data source, and may also include features such as data connections, data validation, and rules.).

Part of the Controls task pane

You can add a control to your form template either by clicking its name in the Insert controls list or by dragging it from the task pane to the form template workspace. Depending on the type of control that you add to your form template, users filling out form will be able to type text into text fields, view data in repeating controls, make selections from option buttons and check boxes, choose entries from lists, and click command buttons to carry out commands. The data that users enter into a control is stored in the form's data source.

The following resources provide additional details about using controls in InfoPath.

Click To
Introduction to controls Learn about the different types of controls that are available in InfoPath.
Design a template part to reuse in multiple form templates Learn how to insert and update template parts. Template parts can help you achieve a consistent design for a collection of form templates. For example, you can create template parts for signature sections. In addition to reusing controls and layout, you can reuse rules, conditional formatting, and data validation.

Step 5: Add data connections

All form templates have a primary data source, which is referred to as the main data source. If you design a form template based on an external data source, such as a database or Web service, InfoPath creates the main data source based on that external data source. Alternatively, if you design a blank form template, InfoPath creates the main data source for you as you add controls to your form template.

As you design your form template, you can also add data connections to one or more secondary data sources. A secondary data source is an XML data file, database, or Web service that is used by a form for the entries in a list box or for script actions. This enables you to populate list boxes and other controls with data external to the form template, such as data that resides in a SQL Server database or SharePoint list. You can also add data connections to secondary data sources when you need users to submit data to more than one external data source.

The following resources provide additional details about secondary data connections and what they are used for in InfoPath.

Click To
Introduction to data connections Learn what a data connection is and how you use one to retrieve and submit data from a database, Web service, or other data source. For example, if team projects are listed on a SharePoint site, you can create a data connection to that list so that the project names appear inside a list box control on the form.
Add a data connection to a SharePoint document library or list Add a secondary data connection to your form template that can either query data from a library or list, or submit data to a library on a server running Windows SharePoint Services.
Add a data connection to a Microsoft SQL Server database Add a secondary data connection to your form template that queries a SQL Server database.
Add a data connection to a Web service Add a secondary data connection to your form template that can either query or submit data to a Web service.
Add a data connection by using settings in a connection library Add a secondary data connection to your form template by using a data connection file stored in a data connection library on a Office SharePoint Server 2007 site. This file stores information about a connection to a data source, such as an Access database, a spreadsheet, or a text file.
Use values from a Web service to populate a list box, drop-down list box, or combo box Populate a list box, drop-down list box, or combo box with data from a secondary data connection to a Web service.
Use values from a SQL Server database to populate a list box, drop-down list box, or combo box Populate a list box, drop-down list box, or combo box with data from a query data connection to a Microsoft SQL Server database.
Configure a secondary data connection for offline use Configure your form template so that forms based on the form template will cache (cache: A special memory subsystem in which frequently used data values, such as files that are made available for use offline, are duplicated for quick access. Changes made to the cached copy of a file are not reflected in the source copy of the file.) data from a secondary data connection when users fill out the form. This is useful when users do not have network connectivity, or when the external data source for the form is otherwise unavailable. In these scenarios, InfoPath displays the cached data in the form, and the form continues to work as expected for the user.

Step 6: Add data validation, rules, and other business logic features

It's important to reduce costs and increase efficiency in your business wherever possible. You can use business-logic features in your form template to help prevent costly data-entry errors and to automate actions in the user's form. When you use InfoPath features like data validation (data validation: The process of testing the accuracy of data; a set of rules you can apply to a control to specify the type and range of data that users can enter.), conditional formatting (conditional formatting: The process of changing the appearance of a control, including its visibility and read-write state, based on values entered into the form.), and rules (rule: A condition or action, or a set of conditions or actions, that automatically performs tasks based on events and values in the form.), you can define conditions and actions that automatically perform tasks that are based on events, such as the opening or closing of a form, or on values that are entered into your form template.

The following resources provide additional details that illustrate the range of business-logic features in InfoPath.

Click To
Add, change, or remove data validation Automatically detect errors as the user fills out a form. By adding data validation to controls in your form template, you can help ensure that the data that you collect is accurate and consistent, and that it conforms to any standards that are already in use in your company.
Apply conditional formatting to a form template Hide or apply formatting to a control, based on conditions that occur on the form. You can use conditional formatting to automatically apply bold, underline, italic, strikethrough, font color, and background color to controls. You can also use conditional formatting to determine whether a control is visible on the form when users fill it out, whether the control is disabled, or whether to enable users to add or remove certain controls, such as optional sections.
Add a rule Add rules that display a dialog box, set a field's value, query or submit to a data connection, switch views, or open or close a form in response to certain events and conditions that occur in the form.
Add a formula to a control Add formulas that calculate data, display specific dates and times in a control, or display the values that users enter into one control in another control.
View the business logic in a form template Use the Logic Inspector dialog box to review all of the data validation settings, calculated default values, rules, and programming features associated with your form template. This helps you avoid the time-consuming process of opening each control individually in order to review these settings.

The business-logic features in InfoPath are all that you need for most form templates. However, if your form template requires additional features that aren't available in InfoPath, you can use code to create custom features. If you want to write script, you can use the Microsoft Script Editor (MSE) (Microsoft Script Editor (MSE): A programming environment used to create, edit, and debug Microsoft JScript or Microsoft VBScript code in an InfoPath form.) to create, edit, and debug Microsoft JScript (JScript: An interpreted, object-based scripting language that borrows from C, C++, and Java. It is the Microsoft implementation of the ECMA 262 language specification.) or Microsoft Visual Basic Scripting Edition (VBScript) (Visual Basic Scripting Edition (VBScript): An interpreted, object-based scripting language that is a subset of the Microsoft Visual Basic programming language.) code. If you want to write managed code, you can use Microsoft Visual Studio 2005 Tools for Applications (VSTA) (Microsoft Visual Studio 2005 Tools for Applications (VSTA): A managed-code programming environment that is used to create, edit, and debug Visual Basic or Visual C# code included in an InfoPath form template.) to create, edit, and debug Visual Basic or Visual C# code. In addition, if you have Microsoft Visual Studio 2005, you can integrate InfoPath design-mode features into the Visual Studio 2005 development environment by downloading and installing Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System on your computer. You can then open Visual Studio 2005, create an InfoPath form template project, and use design-mode features to design your form template. For information on downloading Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System, see the InfoPath Developer Portal on the Microsoft Developer Network (MSDN) Web site.

Step 7: Create custom views

Every InfoPath form template has a default view, which displays when users first open a form based on your form template.

You can use the Views task pane to design additional views of your form template:

Part of the Views task pane

When you design a new view, you typically repeat the process of laying out the form, adding controls to it, and adding data validation or other features.

By creating different views of the form template, you allow users to look at the data in the form in different ways. This prevents you from having to design multiple form templates for the same business process. For example, in a form template that is used for processing insurance claims, you might create one view for policyholders, a second view for insurance agents, and a third view for insurance adjusters. Each of these views is customized to accommodate the type of user who is entering information into it. You can also design custom print views that are used solely for the purposes of printing the form.

Views should be simple and relatively self-explanatory. However, if you want to communicate special instructions to your users, you may need to build assistance into your view. For example, you can create a dedicated Help view for your form template, and then add a button to the default view that users can click in order to access the Help view.

The following resources provide additional details about views.

Click To
Add or delete a view Learn how to add, manage, and delete views.
Create an InfoPath-only view of a browser-compatible form template Learn how to create two views of a browser-compatible form template for two types of users. One view will be for users who open the form template in a Web browser. The other view will be used exclusively by users who have InfoPath installed on their computers. This InfoPath-only view will never be displayed in a Web browser. Consequently, you can use InfoPath features in this view that are not supported in browser-compatible form templates, such as user roles or master/detail controls.
Design a view that is optimized for printing Learn how to design a print view for your form template and other techniques for creating print-friendly form templates.
Add custom Help text to a form template Learn how to design a Help view for your form template and other techniques for displaying custom instructional text to users.

Step 8: Enable submit behavior

When you design form templates to collect data as part of a larger business process, that data usually doesn't stay in the forms that users fill out. Instead, the form data moves from the form to the next stage in the business process — usually to an external data source such as a database or Web service. For example, an employee might use InfoPath to fill out an expense report form, and then submit that form to a Web service where the form can be processed.

Specifying where you want the data in your form template to be submitted can increase the accuracy and efficiency of your business processes, because it allows you to exert more control over those processes. Before users can submit their form data, InfoPath ensures that the data in the forms is valid and allows the users to correct any invalid data. This feature can help ensure that only valid data is sent to the external data source.

The following resources explain how to design your form template so that form data is submitted to a location of your choice.

Click To
Introduction to submitting form data Read about sending form data to a specific location, such as a database or Web service.
Submit form data to several locations Design secondary data connections and rules that submit form data to several locations when users click the Submit button in their form.

Step 9: Enable security features

You should use your organization's existing security policy as the foundation for any choices that you make about the security of your form templates and their related forms.

If you are creating browser-compatible form templates, note that a number of factors affect the security of information stored on servers running InfoPath Forms Services. Some are controlled by you and others are controlled by your administrator, who is the person who sets up and manages user accounts, assigns permissions, and helps users with network or server access issues. You may need to coordinate with the administrator to set the appropriate options for your form template.

The following resources explain how to design your form template with security in mind.

Click To
Security considerations for form templates and forms Read about some best practices for helping to secure form templates and forms, and considerations about server security.
Security levels of InfoPath forms Learn about the three different security levels for forms: Restricted, Domain, and Full Trust. Security levels determine whether a form can access data on other domains, or access files and settings on a user's computer.
Set the required security level for a form template Override the default security setting, which InfoPath automatically selects based on the features in your form template.
Introduction to digital signatures Learn about digital signatures in InfoPath and considerations for using them in browser-enabled form templates. Signing a form helps authenticate a user as the person who filled out the form and helps ensure that the contents of the form are not altered.

Step 10: Test appearance and behavior

Your test plan depends on the complexity of your form template and on existing policies within your organization for deploying form templates. Your test plan can be as simple as previewing the form template to test the behavior and appearance of forms based on your form template. When deploying a form template on a larger scale, more thorough, formal testing may be necessary. For example, you may want to conduct usability testing or schedule pilot deployments with a sampling of users.

The most basic test pass typically involves previewing the form template in the Preview window in InfoPath. The Preview window enables you to view your form as it will appear to users, and enter data in the controls to test their functionality. This allows you to check the alignment and formatting of controls. You can also test the functionality of the controls in your form. For example, you can enter data into controls to make sure that data validation, formulas, rules, and data connections work as you expect them to. In the Preview window, you should also ensure that your form template is free of typos and editorial inconsistencies, and verify that it looks good from a visual standpoint.

 Tip   You can also use the Preview window for simple, iterative testing of controls and form behavior while designing your form template.

While you can do much of the testing yourself, before you publish and distribute your form template, you should test it with users to make sure that it meets their expectations. Ideally, you will publish a pilot form template and distribute it to a small sampling of users. In this way, you can solicit feedback from real users about the overall usability of your form template. You can then make any necessary changes before publishing the form template to a wider audience.

The following resource explains how to use the Design Checker task pane to test your form template.

Click To
Introduction to the Design Checker task pane Learn about the Design Checker task pane, and how you can use it to test the functionality of your form template.

Top of Page Top of Page

Phase 3: Deploy

The process of deploying a form template involves publishing the form template, enabling it for use on the Web (for browser-compatible form templates only), and making users aware of the form template's availability. If you plan to install your form template on users' computers, the publish process may also involve creating a special installation file. You can publish form templates to many locations, including e-mail distribution lists and servers running InfoPath Forms Services or Windows SharePoint Services.

If you're planning to publish a browser-compatible form template to a server running InfoPath Forms Services, you must browser-enable the form template in addition to publishing it. In many cases, you can perform this step during the publishing process by selecting a check box in the Publishing Wizard. However, if your form template includes certain features, such as managed code, you won't be able to browser-enable the form template yourself. Instead, you must save the form template to a shared location, and then let a farm administrator know that it is available for review. The farm administrator can then verify that the form template is free of errors and warnings, upload it to a location on the Web farm, and then activate it in a site collection (site collection: A set of Web sites on a virtual server that have the same owner and share administration settings. Each site collection contains a top-level Web site and can contain one or more subsites.) on the server.

The following resources describe the publishing process and what it entails.

Click To
Introduction to publishing a form template Determine how and where to publish your form template.
Publish a form template to a server running InfoPath Forms Services Publish a browser-compatible form template that can be filled out in InfoPath or on the Web. By reading this article, you can also determine whether you can browser-enable a form template, or whether you need a farm administrator to perform this step for you.
Publish a form template to a server running Microsoft Windows SharePoint Services Publish a form template to a library, which is a location on a SharePoint site where a collection of files is managed. You can also publish a form template as a site content type, which enables you to assign multiple form templates to a single library or to assign the form template to multiple libraries across a site collection.
Publish a form template to a list of e-mail message recipients Distribute the form template in an e-mail message to your users. The Publishing Wizard creates an e-mail message that includes a copy of the form template and the form that is based on the form template. When users open the e-mail message, they can fill out the form directly in the body of the e-mail message.
Publish a form template with full trust Use the Publishing Wizard to create installation files, so that you can install fully trusted form templates on users' computers. A form can run with Full Trust only if its associated form template is digitally signed with a trusted root certificate or if the form template was installed on the user's computer by using an installation program such as Microsoft Windows Installer (.msi file).

Top of Page Top of Page

Phase 4: Maintain

Maintaining a form template involves updating the form template when necessary and releasing new versions. It is also a good idea to periodically solicit feedback from users about the usability of your design. Does the form template still meet their needs, or have those needs changed?

When you publish a form template that you have changed, InfoPath can update both the form template (.xsn file) and any existing forms (.xml files) that are based on that form template. When users open an existing form, they will automatically download the latest copy of the form template, and their form data will be updated to match that version. By default, InfoPath automatically replaces the older version of the form template with the latest version. You can choose the update method that you prefer for updating existing user forms.

If you're a farm administrator for a server running InfoPath Forms Services, and you need to upload a new version of an administrator-approved form template (administrator-approved form template: A browser-compatible form template that has been uploaded by an administrator to a server running InfoPath Forms Services. An administrator-approved form template can include code.), you can determine how the transition between the existing version and the upgraded version will take place. For example, you can choose to replace the form template with a later version without causing data loss to users who are currently filling out your form in a browser. Alternatively, if you have a compelling reason, such as a security fix, you can choose to immediately overwrite the form template.

If you need to update an existing template part, you open it, make the necessary changes, save the template part, and then redistribute it to form designers. After form designers add the latest version of the template part to the Controls task pane, they can use it in their form templates. If they open a form template that contains an older version of the template part, InfoPath will prompt them to update that template part with the latest version.

The following resources describe in more detail how to modify and update form templates and template parts.

Click To
Introduction to updating existing form templates Find out how InfoPath updates a form template and any corresponding user forms. Read about considerations for updating browser-enabled form templates, and about techniques for avoiding data loss in existing user forms.
Modify a published form template Learn how to make changes to a published form template, modify a working copy of the form template, and then republish the working copy to the original publish location.
Move a published form template to a new document library Efficiently move a form template and any existing forms from one library to another. For example, after deploying your form template you might have to move your form template to a server with more capacity so that more users can fill out forms at the same time.
Change or remove a data connection Modify or remove data connections from your form template. You may need to do this if the external data sources for your form template change.
Add, remove, or update resource files in a form template Manage files that are added to a form template to support the functionality of its associated forms. For example, you might need to add an HTML file that is used to display information in a custom task pane (custom task pane: An .html file whose content is displayed in a window next to a form. Custom task panes can provide form-specific commands and Help content.) or modify an XML file that is used to display items in a list.
Change an existing template part Modify the design of an existing template part.

Top of Page Top of Page

Phase 5: Archive

Organizations often archive form templates and forms as the last step in the form-design life cycle. If you no longer need a particular form template, you may want to retire it from use and keep a digital copy of the form template for your records. In addition, you may want to preserve the data collected in forms that are based on that form template.

Many organizations follow strict guidelines regarding the long-term storage and preservation of data in archives. For example, an organization might be required to keep customer transaction records on file for a specific number of years. The archive guidelines in your organization may be driven by internal policies, regulatory compliance, or both. As part of the planning process, you should find out what your policy is.

Archiving the form template

If you're a farm administrator for a server running InfoPath Forms Services, you can retire browser-enabled form templates when they become obsolete. For example, you may want to retire a survey form template when the survey has been completed. In the interest of keeping libraries current and uncluttered, make sure that form templates that are no longer used are retired, and that you have a policy in place for auditing and upgrading existing form templates.

If you plan to retire a browser-enabled form template that is still being used, you should plan to either perform a gradual upgrade or quiesce (quiesce: To gradually bring a farm, service, or form template offline by not accepting new user sessions and allowing existing sessions to finish.) the form template in order to prevent current sessions from being terminated, which could result in the loss of data and an abrupt interruption for users filling out the form.

It's also a good idea to archive the source file for the form template (the .xsn file) in a version control program or another type of file management solution that your organization uses. Doing so helps ensure that you and your organization have a record of the form template that you can use when referring to archives of forms and form data, and in the event that you want to restore or update the form template.

Archiving forms and form data

If your organization uses Office SharePoint Server 2007, you can archive completed, server-based forms (.xml files) by converting them into Web pages. The archived form can be stored in the same library where the original form is located or it can be moved to another location according to your organization's guidelines.

 Note   When you convert a form into a Web page, the resulting file may be slightly different from the original file. You should verify the results of the conversion to make sure that it serves your needs. For example, if a data connection to a secondary data source was used to populate a list box on the form, you won’t see all of the list box values in the archived form. Instead, you will see only the value that the user specified when they filled out the form.

In InfoPath, you can archive a form by opening it and exporting it to one of the following formats:

  • Portable Document Format (PDF)    PDF is a fixed-layout electronic file format that preserves document formatting and enables file sharing. The PDF format ensures that when the file is viewed online or printed, it retains the exact format that you intended and that data in the file cannot be easily copied or changed.
  • XML Paper Specification (XPS)    XPS is an electronic file format that preserves document formatting and enables file sharing. The XPS format ensures that when the file is viewed online or printed, it retains the exact format that you intended, and that data in the file cannot be easily copied or changed.

You can save as a PDF or XPS file from a 2007 Microsoft Office system program only after you install an add-in. For more information, see Enable support for other file formats, such as PDF and XPS.

You can also export a completed form as a Web page, in Single File Web Page (MHTML) (Single File Web Page (MHTML): An HTML document saved in MHTML format, which integrates inline graphics, applets, linked documents, and other supporting items referenced in the document.) format. This file type allows people to view (but not modify) the contents of the form in a browser.

Top of Page Top of Page

 
 
Applies to:
InfoPath 2007