I got frustrated working this same issue about a month ago and just got back to look at it. Glad I saw your post as it motivated me to try to track this down again.
What I found out is that there are some specific rules in Survey123 for related tables and as far as I can tell they are not published anywhere.
The rules are:
- The relationship fields must be GUID fields with the same name in the parent feature layer and the child table. The GUID field cannot be the GlobalID field.
- The label name of each side of the relationship must be the same.
Following these rules I created the attached relationships from your example. I created a GUID field called parentguid in both the parent feature layer and the child tables. Then I created the relationships for each table to the feature layer and labeled both sides of the relationship with the same name as shown in the attached labels image.
When the survey form is created, the parentguid field does not appear in the spreadsheet or on the form. But, when a new inspection is created with the form, the parentguid is apparently automatically filled in with a GUID. When records are added to the tables in the form, their parentguid fields are automatically filled in with the parentguid from the inspections layer.
I verified the results in the REST service and the relationship and related records are there, so I think this is right.
It sounds like ESRI may be planning to support GlobalID's directly in a future release.
I pieced together the solution from the following cryptic post and help file:
https://community.esri.com/thread/192312-survey123-error-global-id-based-relationship-requires-suppo...
https://doc.arcgis.com/en/survey123/desktop/create-surveys/survey123witharcgisserver.htm#ESRI_SECTIO...
The post says
"Survey123 does not work with GlobalID, GUID relationships for related tables (repeats) with Federated Servers yet. It is in the works but is not there just yet. I believe it may be available in the next release in April?? The repeats use ParentRowID/RelatedParentRowID for the repeats."
and
"Yes, there are a few caveats with relationships. From your description, it sounds as if the *relationship* does not have the same name from the parent and child tables - currently Survey123 assumes the relationship name is the same"
The help file says:
"repeats cannot work with related layers or tables unless the relationship uses a GUID field for the relationship in the parent layer"
It is hard to understand why this is not documented somewhere obvious where we can use it. This is pretty much the traditional model for data collection in the field for things like inspections.
I hope this helps.