Lab 13: Schemas in InfoPath 2003

 

Microsoft Corporation

April 2004

Applies to:
    Microsoft® Office InfoPath™ 2003

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)

Download the odc_INF03_Labs.exe sample file.

Contents

Prerequisites
Scenario
Lab Objective
Exercises
Conclusion

Prerequisites

  • A familiarity with Extensible Markup Language (XML) schemas.

Scenario

Contoso Corporation is using a Microsoft® Office InfoPath™ 2003 form built by its information technology department. However, the form needs to be incorporated into another process. To integrate the form with the existing process, you must modify the form's schema.

Lab Objective

In this lab, you learn how to do the following:

  • Manually add new groups to the data source
  • Move groups in the data source
  • Replace data sources

Exercises

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

  1. Start InfoPath.

  2. In the Fill Out a Form dialog box, click Design a Form.

  3. In the Design a Form task pane, click On My Computer.

  4. 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.

  5. Select Lab13Template.xsn, and then click Open.

    The Contoso sales report form opens in design mode.

  6. On the View menu, click Data Source.

  7. In the Data Source task pane, in the Data source list, right-click myFields.

  8. On the shortcut menu, click Add.

  9. In the Add Field or Group dialog box, in the Name text box, type customerInfo.

  10. 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

  1. In the Data Source task pane, right-click customerContainer.
  2. On the shortcut menu, click Move.
  3. In the Movie Field or Group dialog box, in the Select a new group list , click customerInfo.
  4. 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

  1. With the form still open, on the Tools menu, click Convert Main Data Source.
  2. 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.
  3. Click Next.
  4. 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).

Conclusion

In this lab, you learned 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.