English

How To: Set up related tables for use in Collector for ArcGIS

Summary

When working with related tables, some form of unique value is needed to represent the relationship between the 'primary key' and 'foreign key'. It is recommended to create relationships using the GlobalID field on the layer so that the primary key of the relationship is unique when establishing a connection to a new inspection record.

The most convenient way of achieving this is through the use of Global IDs and GUIDs. Both data types store registry style strings consisting of 36 characters enclosed in curly brackets; for example, {90A942E1-BC7C-4F1E-94D5-AACAAD24F08C}.

Global IDs and GUIDs have a few differences, as well. For example, ArcGIS actively maintains Global ID fields (i.e. when a new feature is created, a GUID value is assigned), whereas the GUID fields are left blank. It is up to the user to maintain these fields.

To use related tables in a Relationship Class, the Global ID in the origin table can be used as the primary key, and the GUID field in the destination table can be used as the foreign key. Using this method, ArcGIS automatically copies the primary key (Global ID) into the foreign key (GUID) field.

Procedure

The following is an example workflow that demonstrates how to set up related tables in Collector for ArcGIS. In this example, a relationship is made between a feature class, Weeds, and a related table, Inspections.

  1. Set up the feature class with the desired fields.
  2. Set up the related table with the desired fields.
  3. Add the Global ID field to the Weeds feature class.
    1. Right-click the Weeds feature class in ArcCatalog.
    2. Select Add Global IDs…
  4. Add a GUID field to the Inspections table.
    1. Right-click the Inspections table in ArcCatalog.
    2. Select Properties.
    3. In the Fields page, add a field named Weed_ID and make it type GUID.
  5. Create a relationship class between the feature class and the table.
    1. Right-click ArcCatalog.
    2. Select New Relationship Class…
    3. Follow the prompts. Assign the following:
      • Origin Table = Weeds feature class
      • Destination Table = Inspections table
      • Primary Key = GlobalID (Weeds feature class)
      • Foreign Key = Weed_ID (Inspections table)

Related Information