Relating underarching survey to feature surveys

366
1
07-10-2018 12:42 PM
MattMulder
New Contributor III

Hello all,

Is there a way to create a relationship between multiple surveys to an underarching survey that would receive GlobalID's from the original feature class field. The scenario is this: I have a number of surveys that operate separate of one another for inspections and a survey for reporting unexpected occurrences during these inspection. I would like to relate this report submission back to the original inspection submission for tracking/inventory of these occurrences. I have read Survey123 feature class as a related table, however the way I am understanding the discussion it seems almost inverted to what I'd want (relating all surveys to one overarching table that has the original GlobalID and is relaying to the child surveys vs. backlaying the occurrence survey back to its predecessor). Any ideas? Thanks! 

0 Kudos
1 Reply
JohnathanHasthorpe
Esri Regular Contributor

Hi Matt

Yes this is possible, but there are a few steps:

1) In Connect create a survey from the existing feature service. This will include all questions from the parent and child layers.

2) Delete all questions that relate to the parent layer and also delete the start and end repeat questions.

3) Update the form_id in the settings tab with the name of the related table. This means that the survey will now be pointing towards the related table.

4) Add a new text question that has the same name as the GUID field in your related table (e.g. parentglobalid) and set its bind::esri::fieldType value to be esriFiedlTypeGUID.

5) Publish the survey

At this point you can submit surveys to the related table, and they will be related to the parent layer based on the GlobalID value of the parent. Therefore the user will need to populate the parentglobalid question created in step 4) with a valid GlobalID. There are 2 options to do this.

1) Create a choice list with a label of something understandable like asset ID and a name with the corresponding parent GlobalID. This means the user could select the asset ID in one question and you could use the returned name value to populate the parentglobalid question. 

2) Use app linking/custom urls to populate the form with the parent globalID. The user could launch the survey from Collector and the GlobalId can be passed in through the url. 

This is pretty high level, so please let me know if you need further clarification on these steps.

Thanks

John