Map Viewer 'Create Related Record' not carrying over primary key to foreign key

197
2
a month ago
Labels (3)
Kklitt
by
New Contributor II

Hello!

I created a 1:M relationship class between a point layer (origin) and a table (destination). EDIT: In the same gdb I have a 1:M relationship class between a polygon layer (orgin) and the same table as above (destination). Both relationships are set up with the primary key as the GlobalID (in the point and polygon layer) and foreign key as a created GUID field Log_GUID. The gdb was created in ArcGIS Pro then published to AGOL as a hosted feature layer. The relationship works as expected in Pro, but after publishing to AGOL the primary key does not copy to the foreign key when creating a new related record. 

To make it even weirder, when creating the record in the form, the primary key copies(!) but as soon as I submit the record the primary key disappears and leaves the field blank. See images below:

1. Relationship class setup in pro before publishing to AGOL:

Kklitt_0-1712249962084.png

 

2. Create new record in Map Viewer using forms:

Kklitt_1-1712250133920.png

 

3. Form populates with the correct primary key into the foreign key field

Kklitt_2-1712250167430.png

 

4. Data is created without any error but not related to origin layer. The primary key doesn't carry over to the foreign key.

Kklitt_3-1712250251255.png

 

Why is this happening? It seems like it's working fine until I actually submit the form.

 

0 Kudos
2 Replies
EmilyGeo
Esri Contributor

Hi @Kklitt

This does seem odd. We'll need more information in order to see what's going on. I recommend reaching out to tech support to get a ticket started so we can investigate. 

In the mean time, if you can share a link to your map with me I'll take a look at it.

0 Kudos
Kklitt
by
New Contributor II

I found the answer here: Multiple Feature Classes to One Related Table - Esri Community

When multiple feature classes are related to one table in a gdb and the end goal is for it to work in the AGOL environment, multiple GUID fields need to be created for each relationship class. 

For example, with the issue I laid out above, I had to create two separate GUID fields in my table for each feature class that's related:

Point feature class --> Table

  • Primary key = GlobalID
  • Foreign key = Point_GUID

Polygon feature class --> Table

  • Primary key = GlobalID
  • Foreign key = Polygon_GUID

 

@EmilyGeo Is this normal behavior? And if so, it'd be super helpful (and a huge time savor) to have this mentioned in the documentation. This was especially confusing since it worked as expected in ArcGIS Pro with one general foreign key (Log_GUID) and looked like it was going to work in AGOL (primary key copied in the form) but never actually did.

0 Kudos