English

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

Summary

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

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

Global IDs and GUIDs have a few differences. ArcGIS actively maintains Global ID fields (that is, when a new feature is created, a GUID value is assigned), whereas, GUID fields are left blank. The onus is on 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 workflow demonstrates how to set up related tables for use in ArcGIS Collector or ArcGIS Field Maps by adding Global IDs in ArcCatalog. 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 Manage > Add Global IDs…
  4. Add a GUID field to the Inspections table.
    1. Right-click the Inspections table in ArcCatalog.
    2. Select Properties.
    3. On the Fields page, add a field named Weed_ID and specify the Type as GUID.
  5. Create a relationship class between the feature class and the table.
    1. Right-click the file geodatabase in 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

Last Published: 4/5/2021

Article ID: 000015422

Software: ArcGIS Collector (Android) 20.2.2, 20.2.1, 20.2.0, 20.1.0