Survey123 with related tables

2381
5
12-12-2021 02:04 AM
JohncHewitt
New Contributor

Hi,

I would appreciate some advice ion an issue I'm having trying to publish a relationship class for use within Survey123. I have a point feature class that is related to a table based on an existing ID of type double. However, I have read that the ID linking the parent and child tables must be a GUID. So my simple question is, how can I ensure the GUID I create on the feature class and table maintain the existing relationship between them/ Can I derive the GUID from my existing ID, so the link is maintained, or am I missing something?

Thanks in advance,

John

5 Replies
FrankOuyang
Esri Contributor

Hi John, have you tried the steps in this link? I think step 4 may answer your question?  Another factor to consider is in you spreadsheet: bind::esri:fieldType should be esriFieldTypeGUID to maintain the relationships between feature class and the table  (step 7 in the link).

 

0 Kudos
JohnHewittGlenavy
New Contributor

Hi Frank, I really appreciate the reply, thanks for the help with this. I think there is something I'm missing in this procedure. My existing point feature class and related table are linked via an existing ID (PNAME_ID) of type double. The bit I don't understand is, if I create a new GUID field in the point feature class and the table, how do I connect existing records in the way they are linked by the PNAME_ID field being in both. Do I need to write a script to populate each GUID in the child table to be the same value as the GUID in the parent table if the PNAME_ID in each table matches?

I.e. something like this in psuedo-code...

For each row in child table

   If Child_Table.PNAME_ID = Parent_Feature_Class.PNAME=ID

   then Child_Table.GUID = Parent_Feature_Class.GUID 

Otherwise I can't see how creating arbitrary GUID's in each table maintains that relationship?

Thanks again for the help with this, its very much appreciated,

Best wishes,

John

0 Kudos
DougBrowning
MVP Esteemed Contributor

Are you trying to make a relationship that will work in the form - in other words your form has a repeat?  If so then you need to use a field name of parentglobalid in the child and link it to the globalid in the parent.  You can have a second relationship but at least one must follow the convention.

If you are relating a stand alone feature class to a form then you can use any names you want.  You would need to match the keys manually for any existing record.

Need some more info here I think.  

0 Kudos
JohnHewittGlenavy
New Contributor

Fantastic, I did exactly what you said and it worked. I added the GUID field to both, manually matched the existing keys and created a join to populate the GUID's on the child table so link the existing records. All worked and I published to AGOL successfully.

I have now hit a second issue. I have nested repeats (My point feature class links to a table which links to another table). I added the Survey123 form I created with the relationship class ini it into a dashboard so I can edit the features. However I get an error when I update the Survey123 URL in my dashboard to add ?mode=edit ' - 'The Survey contains repeats which are not supported in view or edit mode of the Survey123 web app. Is there an alternative way that I can update the survey within ArcGIS Online?

JohnHewittGlenavy_0-1639410815952.png

 

0 Kudos
FrankOuyang
Esri Contributor

Hi John, glad to hear that you have been making progress. To answer the question you have now, not all types of questions can be edit online at the moment. You will probably need to download Survey123 Connect to edit it on a desktop machine to access the full edit functionalities, as explained here

0 Kudos