Select to view content in your preferred language

How are repeats related to the related tables?

2453
5
03-15-2019 05:49 AM
by Anonymous User
Not applicable

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)
0 Kudos
5 Replies
JamesTedrick
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. 

by Anonymous User
Not applicable

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.

0 Kudos
JamesTedrick
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.

0 Kudos
by Anonymous User
Not applicable

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.

0 Kudos
DougBrowning
MVP Esteemed Contributor

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.

0 Kudos