Select to view content in your preferred language

Problems with GUID autopopulate and Create Relationship Class

471
5
04-03-2026 11:43 AM
PhillipHinz_1
Emerging Contributor

Does a table relate need to exist before a relationship class is created?  I am trying to make a relationship class between two tables with existing data. 1 to 1 cardinality. The two tables share the same ProjectCodes, so normally I would just establish my relate or join based on those.  But I am told I should use GlobalID (parent table) and GUID (the parent's GlobalID) as the basis of the relationship. I activated GlobalID and added a field in the child table with the GUID data type. Since the GUID field was just made, the contents are NULL. GUID is supposed to be automatically populated with the Parent Global ID, but how can it do this without first going through the process of creating a relationship?
The Create Relationship Class Geoprocessing tool requires you to place the Origin Primary Key and the Origin Foreign Key. And many tutorials say to use the Global ID and the GUID, but the GUID is empty at this point. Am I missing a step here?
Eventually I am bringing a parent table and multiple child tables into Survey123 to create an inspection collector.
Many Thanks,
Phillip

0 Kudos
5 Replies
Neal_t_k
MVP Regular Contributor

Couldn't you just do a join on the two tables using your project codes,  calculate the GUID in the child table to equal the GlobalID in the parent, then create your relationship using GlobalID to GUID.

0 Kudos
PhillipHinz_1
Emerging Contributor

That is exactly my question, is the relate necessary before doing the relationship class to achieve just what you suggested.  Unfortunately, the instructions don't say to do this and say that the GUID field will auto populate. They don't say when or how or under what conditions it will auto populate, so I am wondering if I am missing a step or just don't understand something.

0 Kudos
HannesVogel
Frequent Contributor

when you have a relationshipclass, you can select a parent feature and use the attribute window in ArcGIS Pro in the ribbon in the middle and select in the attribute table as well a child and right-click your selected parentfeature and choose something like "add selected to relate" or "add new to relate". Technically it just writes the parent-globalid to the child GUID field.

With the relationshipclass, different ESRI software elements (Survey123, Field Maps, ArcGIS Pro, Mapviewer in Browser, ...) "knows" which child belong to which parent but you can edit the GUIDs separatly also without the relationshipclass in the beginning.

0 Kudos
DougBrowning
MVP Esteemed Contributor

It will on new records but not old records.  Which makes sense how would it kick off a job to fill all those out?  As others posted you can join on your relate and calc over the globalid to get started.

Personally I have 2 relates, one with my own key and one to make 123 happy.  I got a write up on it here.  https://community.esri.com/thread/221263-mapping-with-survey123-within-a-polygon-or-admin-unit

Hope that helps

 

0 Kudos
AbdelmonamTaha
Emerging Contributor

Prepare your data (non-negotiable)

Before creating the relationship:

 Ensure both datasets exist

Feature class or table (Origin)

Feature class or table (Destination)

. Verify key fields

You need:

Primary key in origin (e.g., Parcel_ID)

Foreign key in destination (same values)

Requirements:

Same data type (e.g., both Long Integer or Text)

No nulls (recommended)

Unique values in origin (for 1:M)

0 Kudos