How to switch relationship from a Unique ID (integer) to GLOBALID in Survey123 Connect?

1372
8
Jump to solution
01-22-2021 11:00 AM
ScottLehto3
Occasional Contributor

Hi, I have a feature service that i edit that has related tables that uses a unique id that is integer. It has about 10,000 records

In Survey123, relationships using integers are not allowed and i have to use Global ID.

I am looking for directions on how i would make this change to use Global ID. I can see how i can create columns such as a GUID Column, but i don't see how i can populate the GUID Column and maintain my existing parent/child relationship amongst my features.

Just wondering what the best practice is here.

 

Thanks

1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

Bummer.  123 cannot have 2 fields with the same name in it.

Anyways here is what I do.  I let 123 manage the globalid relationship.  Then I have a second relationship class that uses my own key.  I just pass the value from parent to repeat in the form using calc column.  Then both my relationships just work.  The parent is PointID and repeat is RepeatNamePointID.

But for me we download the feature service at the end of each season.  At that point I can calc RepeatPointID into PointID in the child.  If you are going to leave it in the hosted feature service forever that is harder.  Unless it is a SDE based feature service.  If so you could use Attribute Rules to calc in the key as records are added.

I hope that makese sense and helps you.  I never use globalid in relationships.  Total mess.  See here https://community.esri.com/t5/arcgis-collector-questions/related-tables-for-offline-data-collection/... 

View solution in original post

8 Replies
DougBrowning
MVP Esteemed Contributor

Does your current relationship use the same field name in the parent and child?  Like PlotID and PlotID?  Or are they different like PlotID and TableID?

ScottLehto3
Occasional Contributor

Thank you Doug for your reply.

 

They are the same. The field name "server_id" is used in the parent table and two related tables. Both related tables are Composite and One to Many.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Bummer.  123 cannot have 2 fields with the same name in it.

Anyways here is what I do.  I let 123 manage the globalid relationship.  Then I have a second relationship class that uses my own key.  I just pass the value from parent to repeat in the form using calc column.  Then both my relationships just work.  The parent is PointID and repeat is RepeatNamePointID.

But for me we download the feature service at the end of each season.  At that point I can calc RepeatPointID into PointID in the child.  If you are going to leave it in the hosted feature service forever that is harder.  Unless it is a SDE based feature service.  If so you could use Attribute Rules to calc in the key as records are added.

I hope that makese sense and helps you.  I never use globalid in relationships.  Total mess.  See here https://community.esri.com/t5/arcgis-collector-questions/related-tables-for-offline-data-collection/... 

ScottLehto3
Occasional Contributor

Okay. I think i understand. I will adjust my feature services to not have duplicate names and then i will let Survey123 use the Global ID's and i will try the second relationship as well.

When there are new technologies, there's always caveats.

0 Kudos
ScottLehto3
Occasional Contributor

One more question, If you have data in your feature service, how do tell Survey123 that its related when you create a new survey from an existing feature service?

0 Kudos
NatalieSlayden
New Contributor III

@DougBrowning do you have an example of the calculation you used to pass the primary key value from the parent to the repeat? I have two forms connected to the same feature service so I am having a little trouble pass the Parent Primary Key from form 1 to the child primary key in form 2

0 Kudos
DougBrowning
MVP Esteemed Contributor

You don't.  Just pass the ID to the parent then use 123 calculation to get it into each repeat.

Parent

           PrimaryID field - with value passed in

Repeat

          RepeatNamePrimaryID field with a calc of ${PrimaryID}

Hope that makes sense

NatalieSlayden
New Contributor III

Ah Thank you @DougBrowning. That makes total sense now!