Configure a secondary data connection for offline use

If you are designing a form template that users may fill out on a computer that does not currently have network connectivity or the external data source for the form is unavailable, you can configure the form template so that forms based on that form template will cache data from a secondary data connection every time the form uses this data connection.

Note: You cannot configure a form template's main data connection to cache data from an external data source. The main data connection in a form can only get data if the form is connected to a network.

In this article

Overview

Compatibility considerations

Configure the data connection for offline use

Change the offline behavior of the form template

Overview

A form that is based on a form template may contain secondary data connections that get data from external data sources that a user needs to fill out and submit the form. To enable users to fill out forms based on this form template when their computers are not connected to a network or when the form cannot connect to an external data source, you can configure the form template to allow forms to cache the data on the users' computers whenever the form uses the secondary data connection. When the data from a secondary data connection is cached, the user has access to the data even if their computer is not connected to a network or the external data source is not available.

Security Note: Before you configure the form template to allow forms to cache the data from a secondary data connection, consider what could happen to the data if the computer is lost or stolen. If you are using a secondary data connection to get sensitive data, you may not want to enable this feature to help protect the data in case the computer is lost or stolen. If the form is retrieving sensitive data, you may want to configure the secondary data connection to get data only if the computer is connected to a network.

If you configure your form template to allow forms to cache data from a secondary data connection, Microsoft Office InfoPath stores that cached data on the user's computer whenever the form uses any secondary data connection. If you have more then one secondary data connection in your form template, you must configure the form template to cache data from all of the data connections. You cannot configure the form template to cache data from only specific secondary data connections.

By default, InfoPath configures the form template so that its forms cache this data indefinitely. You can configure the form template so that its forms can access this cached data for only a specified number of days. If you configure the form template so that its forms store that cached data for a specified number of days, InfoPath prevents the form from using the data in the cache after that number of days has passed. The data in the cache remains on the user's computer until InfoPath overwrites the old data in the cache with new data or the user removes the form from their computer through the Getting Started dialog box. The Getting Started dialog box appears when you start InfoPath.

Security Note: The data in the cache is stored in a file as plain text that can be read in a text editor, such as Notepad. If you are using a secondary data connection to get sensitive data, you may want to configure the secondary data connection to get data only if the computer is connected to a network.

By default, InfoPath allows users to fill out forms even if the form is unable to retrieve data from its secondary data connections. However, you can configure your form template to prevent users from filling out forms if they are not connected to a network. For example, if you have a secondary data connection that only gets data when the user first opens the form, and that secondary data connection is not available when the user opens the form, you can configure the form template to display a warning message, and then close InfoPath.

To configure the form template to cache the data from a secondary data connection, you can use the Data Connection Wizard when you create the data connection or you can configure the form template through the Data Connections dialog box, which you can access by clicking Data Connections on the Tools menu. By default, InfoPath configures the form template so that users can fill out forms based on this form template without any data from the secondary data connection and store any data from a data connection indefinitely. You can change this default behavior through the Form Options dialog box.

Top of Page

Compatibility considerations

Although you can configure a browser-compatible form template to allow forms to cache the data from a secondary data source, only forms that are filled out in InfoPath can cache the data. Forms that are filled out in a Web browser cannot cache data from a secondary data connection.

Top of Page

Configure the data connection for offline use

If you have already configured your form template to cache data from a secondary data connection, you can skip this procedure and simply change the default offline behavior of forms based on your form template.

Security Note: Before you configure the form template to allow forms to cache the data from a secondary data connection, consider what could happen to the data if the computer is lost or stolen. If you are using a secondary data connection to get sensitive data, you may not want to enable this feature to help protect the data in case the computer is lost or stolen. If the form is retrieving sensitive data, you may want to configure the secondary data connection to get data only if the computer is connected to a network.

  1. On the Tools menu, click Data Connections.

  2. In the Data connections for the form template list, click the secondary data connection that you want to configure for offline use, and then click Modify.

  3. In the Data Connection Wizard, click Next until you see a page with the Store a copy of the data in the form template check box.

  4. Select the Store a copy of the data in the form template check box.

  5. Click Next until the wizard closes.

  6. Repeat steps 2 through 5 for any other secondary data connection that you want to configure for offline use.

Top of Page

Change the offline behavior of the form template

By default, InfoPath allows users to fill out forms based on your form template even if the data from a secondary data connection is not available. InfoPath also makes the data in the cache available indefinitely. You can configure your form template to allow your users to fill out forms only if data is available from the secondary data connection. You can also set a limit on how long the data in the cache should be available.

  1. On the Tools menu, click Form Options.

  2. In the Category list, in the Form Options dialog box, click Offline.

  3. To allow your users to fill out forms based on this form template only if the data from a data connection is available, clear the Allow users to fill out this form if data is unavailable check box. If this check box is clear and the data connection is configured to get data when the user creates a form based on this form template, the user will see a warning message. After the user clicks OK, InfoPath closes.

  4. To make the data from a secondary data connection available for a specified number of days, select the Store data returned from queries so it can be used in Offline Mode check box, click Stored queries expire after this number of days, and then click the number of days.

Top of Page

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!

×