Select to view content in your preferred language

Related table repeats and survey design

354
2
Jump to solution
04-03-2025 04:33 AM
ebrays
by
Emerging Contributor

Hi, I'm hoping someone with more Survey123 Connect knowledge and skill than I can assist with this.

I have a feature layer which consists of a point layer and a related table. I have made a survey from this within Survey123 Connect. The related table is within a repeat and the point layer data outside. 

Within the survey, I would like to mix some of the questions that direct to the point layer and the related table. This will make it read much more sensibly to the surveyor. 

 

Eg: Point layer fields: 1, 2, 3   ///   Related table fields: 5, 6, 7

Currently the survey reads as: 1, 2, 3, (begin repeat) 5, 6, 7 (end repeat)

I would like the survey to read: 5, 6, 1, 2, 3, 7.

 

When I try to make two repeat groups I get an error. Understandable as it is using the same 'name' (related table name) twice. I have also tried to add a group within the related table repeat but this does not work either as it looks for those fields within the related table rather than the point layer. 

Making multiple related tables would be unsuitable. I am considering adding some dummy fields to the related table and using pulldata functions to put this data into the point layer, but this is not an ideal workaround and will make this survey more complicated than it needs to be for future survey years. 

Does anyone have any ideas on how to mix survey questions that direct to different sub-layers? 

Any help or advice greatly appreciated!!

 

0 Kudos
1 Solution

Accepted Solutions
TylerGraham2
Frequent Contributor

Making the dummy fields would be the best option, in my opinion. If you want questions from the repeat table in the main body of the form you have to create a new question for each outside of the repeat. If you're trying to get someone to enter data for question 5 in the main body of the form rather than the repeat, create a question 5a in the main body, set the esriFieldType to null (so it won't create a new field in the feature service) and use a calculate formula on question 5 in the repeat table to populate the value from 5a. If you don't want people to see question 5 twice in the form, set the appearance for question 5 in the repeat to hidden. That way someone will be entering question 5 in the main body, it will go to the repeat table, it won't be visible twice to the form user (possibly confusing them), and it won't have an extra field with duplicate data in the feature service.  

When you're working from an already published feature service you're essentially locked into the schema unless you add additional tables through ArcGIS Pro, create the relationships, and republish the service.  In survey123, repeats create a related table so when you try to add a new repeat in a form that is referencing an existing service, it is looking for a related table that doesn't exist.  

Instead of having to constantly edit an existing service in pro, copy your xls file, delete the url in the submission_url in settings, and start a new survey with it.  That will let you play around with it more freely and create new relates so you can test for a solution and then you go and adjust the feature service accordingly.  

 

View solution in original post

2 Replies
TylerGraham2
Frequent Contributor

Making the dummy fields would be the best option, in my opinion. If you want questions from the repeat table in the main body of the form you have to create a new question for each outside of the repeat. If you're trying to get someone to enter data for question 5 in the main body of the form rather than the repeat, create a question 5a in the main body, set the esriFieldType to null (so it won't create a new field in the feature service) and use a calculate formula on question 5 in the repeat table to populate the value from 5a. If you don't want people to see question 5 twice in the form, set the appearance for question 5 in the repeat to hidden. That way someone will be entering question 5 in the main body, it will go to the repeat table, it won't be visible twice to the form user (possibly confusing them), and it won't have an extra field with duplicate data in the feature service.  

When you're working from an already published feature service you're essentially locked into the schema unless you add additional tables through ArcGIS Pro, create the relationships, and republish the service.  In survey123, repeats create a related table so when you try to add a new repeat in a form that is referencing an existing service, it is looking for a related table that doesn't exist.  

Instead of having to constantly edit an existing service in pro, copy your xls file, delete the url in the submission_url in settings, and start a new survey with it.  That will let you play around with it more freely and create new relates so you can test for a solution and then you go and adjust the feature service accordingly.  

 

ebrays
by
Emerging Contributor
TylerGraham2  Thanks so much for your help and such a speedy response! This solution's worked really well - using a mix of esriFieldType null in the main body and hidden calculations in the repeat
0 Kudos