How are repeats related to the related tables?

477
5
03-15-2019 05:49 AM
Highlighted
Occasional Contributor II

So from what I've learned between the help and other GeoNet posts, for each repeat in a survey, it creates a related table. My question is - what is being used for that relationship for each repeat? Is it a GlobalID, UUID, or some other unique identifier? How does S123 know that each "repeat" is tied to a specific table for each survey submission?

And can we somehow control what is being used for the relationship, or point the related tables to use a different field? I have someone who is creating a survey and has a calculated field using a technicians assigned number and the time to get a unique ID of the person and the record. Can we somehow make the repeats use this for the related table?

Tags (1)
Reply
0 Kudos
5 Replies
Highlighted
Esri Esteemed Contributor

Hi Nathan,

Survey123 requires that a GUID (either GlobalID or other GUID) be used as the relationship key between a parent layer and a repeat table.  When publishing from Survey123 Connect, you can click on the 'Options' and set whether to use GlobalID (the default) or another GUID field that will be automatically created.

If you have existing tables, they will need to have a relationship class (1:M, based on a GUID field) for Survey123 to be able to read this as a repeat section. 

Reply
0 Kudos
Highlighted
Occasional Contributor II

James, so either way it is a GUID? We can't use S123 and related tables with a different related field? Or make multiple repeats go into one related table instead of multiple ones for each repeat? We have workflows in the field where one spot could have one repeat or 5 repeats, so having numerous related tables isn't preferred. If we could have all the repeats go into one master related table, would make it easier. Just wondering if that's doable.

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi Nathan,

The nature of a repeat section is to allow multiple entries to be placed into a related table.  You certainly could construct a large related table and hide or show questions using form logic.

Reply
0 Kudos
Highlighted
Occasional Contributor II

use GlobalID (the default) or another GUID field that will be automatically created. So we can't tell S123 which field to use for the relate unless we create the layer and table first, publish it, and then point the survey to that? Seems odd that we can uncheck use GlobalID but then it just automatically creates a different field to use without us being able to control that.

Reply
0 Kudos
Highlighted
Frequent Contributor II

I do both.  I let Survey123 keep up the GUID in the background then I create a second Relationship class in the DB that uses the Key I want to use.  I just have my repeat inherit it with a calculation in the form.  This has saved us at times when our Key gets messed up we can always use the Survery123 one to fix it.

Reply
0 Kudos