Connect a form to a SharePoint site

You can create a data connection (data connection: The connection between an InfoPath form and an external data source, such as a database, Web service, SharePoint library, or XML file. Data connections are used to query and submit data.) in your Microsoft Office InfoPath 2003 form that receives data from a Microsoft Windows SharePoint Services site or submits your form to a Windows SharePoint Services form library (form library: A folder in which a collection of forms based on the same template is stored and shared. Each form in a form library is associated with user-defined information that is displayed in the content listing for that library.).

ShowReceive data from a Windows SharePoint Services site

When you add a data connection to your form that receives data from a Windows SharePoint Services site, Microsoft Office InfoPath 2003 creates a secondary data source for your form. This data source lets you populate list boxes with values from the site, and bind controls to the fields (field: An element or attribute in the data source that can contain data. If the field is an element, it can contain attribute fields. Fields store the data that is entered into controls.) and groups (group: An element in the data source that can contain fields and other groups. Controls that contain other controls, such as repeating tables and sections, are bound to groups.) associated with the site. In general, you can work with the secondary data source in many of the same ways that you work with your form's primary data source.

 Note   The values associated with a secondary data source cannot be saved when a user fills out a form, although they can be submitted to a Web service using a submit data connection. In addition, you cannot edit the properties or structure of the fields and groups associated with a secondary data source, nor can you specify default values or custom, noncode-based 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.) for those fields.

  1. In design mode, click Data Connections on the Tools menu.
  2. In the Data Connections dialog box, click Add.
  3. In the Data Connection Wizard, click Receive data, and then click Next.
  4. On the next page of the wizard, click SharePoint library or list, and then click Next.
  5. On the next page of the wizard, type the location of the Windows SharePoint Services form library or list you want to connect to, and then click Next.
  6. If requested, click the list or library that you want to use in the Select a list or library box, and then click Next.
  7. On the next page of the wizard, select the check boxes whose values you want to receive, and then click Next.
  8. On the next page of the wizard, type a name for the data connection.
  9. If you want to automatically receive data whenever the form is opened by a user, select the Automatically retrieve data when form is opened check box, and then click Finish.

 Note   If the form does not automatically receive data, you may want to insert a button that retrieves the data when clicked.

ShowSubmit data to a Windows SharePoint Services form library

  1. In design mode, click Data Connections on the Tools menu.
  2. In the Data Connections dialog box, click Add.
  3. In the Data Connection Wizard, click Submit data, and then click Next.
  4. On the next page of the wizard, click To a SharePoint form library, and then click Next.
  5. In the SharePoint form library box on the next page of the wizard, type the location of the Windows SharePoint Services form library you want to submit data to.

 Note   You must type the location of the form library itself, rather than a site within the form library. For example, use the format http://yourserver/yoursite/ instead of http://yourserver/yoursite/forms/AllItems.aspx.

  1. In the File name box, type the name that the form will have when it is submitted to the form library. To specify a name that is based on a value in the form, click Insert Formula Button image, and then use the options in the Insert Formula dialog box to add a formula.

 Note   Basing a name on a formula may prevent duplicate file names from overwriting each other in the form library.

  1. To overwrite a file in the form library if it has the same name as the submitted file, select the Allow overwrite if file exists check box.
  2. Click Next.
  3. On the next page of the wizard, type a name for the data connection, and then click Finish.

 Note   The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed.

 
 
Applies to:
InfoPath 2003