Select to view content in your preferred language

Specify which relationship class to use for a repeat when multiple relationships exist

467
4
Jump to solution
03-25-2024 12:51 PM
BrennanSmith1
Regular Contributor

I have a Point (0) and a Polygon (1) layer, both of which are related to an Inspection (4) table.  I have successfully published a survey form for my points, that includes a repeat for the inspections.  When I try to publish the comparable form for my polygons, I get "Parent layer ID 0 not found for table Inspections".

I checked the debug log, and when checkRelationship is called from PublishServiceCheck.qml, I can confirm it is drawing from the wrong relationship class (Inspection2Point instead of Inspection2Poly).  What I find interesting is that in the Feature serviceInfos output in the Debug log, just a few lines earlier, does see both relationships for my Inspection table.

Is there a way to force my repeat to look for the correct relationship class? Or is the only work around to separate my inspection table into two distinct tables?

0 Kudos
1 Solution

Accepted Solutions
MobiusSnake
MVP Regular Contributor

I haven't tried this, it's a total shot in the dark, but maybe try this:

  • Create a hosted feature layer view with only your polygon and inspections layers
  • Publish the polygon-based form to this view

My thinking is that maybe the view won't expose the relationship between the point layer and the inspections, since the point layer is excluded from the view, and it'll use the first parent relationship it sees - the one between the polygons and the inspections.  Good luck!

View solution in original post

4 Replies
MobiusSnake
MVP Regular Contributor

I haven't tried this, it's a total shot in the dark, but maybe try this:

  • Create a hosted feature layer view with only your polygon and inspections layers
  • Publish the polygon-based form to this view

My thinking is that maybe the view won't expose the relationship between the point layer and the inspections, since the point layer is excluded from the view, and it'll use the first parent relationship it sees - the one between the polygons and the inspections.  Good luck!

BrennanSmith1
Regular Contributor

I never would have thought of this - it worked!  Thank you

0 Kudos
DougBrowning
MVP Esteemed Contributor

Does your begin repeat name column match the name in the service exactly?

Do you have a parentglobalis field in both inspection tables?  123 can only use these for the relate not a custom relate.  You can have both however and self manage the other key.

Are you using a submission URL to point to the correct service?

That is a start it is a bit of an advanced topic.   I have a post here that may help  https://community.esri.com/t5/arcgis-survey123-questions/mapping-with-survey123-within-a-polygon-or-... 

BrennanSmith1
Regular Contributor

Hi Doug, thanks for checking this out with me.  I am using the globalID field in my Point and Polygon layers, joined to a 'featureguid' GUID field in my Inspections table. This was all set up with relationship classes in a file geodatabase and published as a hosted feature layer to an Enterprise portal.  The submission URL is pointing to the correct service.  Everything is working as intended with the survey form for my Point layer, and this error only occurs for my Polygon layer.  I've done a very similar workflow on other projects and never had any issues, but this is my only instance of two different layers being related to the same table. Luckily, creating a new view with the Points omitted seemed to do the trick!

0 Kudos