Lab 13: Working with Schemas in InfoPath 2003
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Summary: Learn how to create new groups in the form's schema, move existing groups to new locations in the schema, and replace one schema with a different one. (3 printed pages)
Updated August 2007
Applies to: Microsoft Office InfoPath 2003
Download the odc_INF03_Labs.exe sample file.
Exercise 1: Add and Move a Group in the Data Source
The data source determines the structure of fields and groups that define and store data for an InfoPath form. In some cases, the fields or groups in the data source may not be compatible with the structure of the back-end process. In this scenario, the customerContainer group needs to be placed in another group named customerInfo. In this exercise, learn how to add a group to the data source and then move that group to another group in the data source.
To add a group to the data source
Start InfoPath 2003.
In the Fill Out a Form dialog box, click Design a Form.
In the Design a Form task pane, click On My Computer.
In the Open in Design Mode dialog box, locate the folder where you installed the training files, and then double-click the Lab 13 folder.
Select Lab13Template.xsn, and then click Open.
The Contoso sales report form opens in design mode.
On the View menu, click Data Source.
In the DataSource task pane, in the Data source list, right-click myFields.
On the shortcut menu, click Add.
In the Add Field or Group dialog box, in the Name text box, type customerInfo.
In the Type list, click Group.
Now that you have created the customerInfo group, you need to move it to the appropriate location in the data source.
To move the group to another location
In the Data Source task pane, right-click customerContainer.
On the shortcut menu, click Move.
In the Movie Field or Group dialog box, in the Select a new group list , click customerInfo.
When prompted to continue, click Yes.
Exercise 2: Replace the Form's Schema
To accommodate the back-end process, you discover that you need to make more changes to the schema then you expected. To save time, you can replace the form's entire schema with a schema that the developer who designed the back-end process has given you.
To replace the form's schema with a new schema
With the form still open, on the Tools menu, click Convert Main Data Source.
In the Data Source Wizard, click Browse. Locate the folder where you installed the training files. In the Lab 13 folder, find and open the file called newschema.xsd.
When prompted to add an additional schema, click No, and then click Finish.
Fields and groups from the new schema now appear in the Data Source task pane (the schemas are similar, but now the salesRepresentative, period, email, and department nodes are grouped under the reportHeader group).