Select to view content in your preferred language

Display a select_one label in a Report template

475
7
2 weeks ago
Trippetoe
Frequent Contributor

Greetings. In my survey i have a select_one question where the answers are populated via 'autocomplete search()' functionality. The 'name' value, that is the 'id' of the selected answer, is being stored in the survey's feature class as the actual answer to the question. The 'label' value of the selected answer is stored in the Survey as a calculated field but its esri:fieldType is 'null' so i think it's value is not kept when the survey is submitted.

Is there a way to get that 'label' value for display in the survey Report template. The 'id' value won't mean anything to Report readers; only the 'label' will.

Thank you

0 Kudos
7 Replies
Neal_t_k
Frequent Contributor

Any reason why you can't just store the label value, and pull that into the report?  That is probably your easiest solution.  

Trippetoe
Frequent Contributor

Hey @Neal_t_k Thanks for your super fast response.

Agreed that just storing the label value is the easiest for reporting. The reason it's not my preferred approach is that currently i am storing the 'id' value which can never change whereas the 'label' value can and does change. The data is the 'location' where the work was done - its id value wont/cant change based on company 'business rules'. However the name of the site can change. It doesn't happen often, but it does happen. In those cases, i'd have to go back thru all the previously submitted records and change the location label value. So, it's a classic data maintenance and QA/QC reason for not storing the 'label' 

0 Kudos
Neal_t_k
Frequent Contributor

In that case you might be able to employ some conditional statements in the report to accomplish what you want, but  that may cause similar headaches  to the ones you mention above depending on the size of your list in that you would still have to update the template when labels change.

https://doc.arcgis.com/en/survey123/browser/analyze-results/featurereport-conditionalelements.htm

 

Trippetoe
Frequent Contributor

Thanks for the link. I've been looking for something like that. 

There are a couple hundred sites so that may not be an efficient approach for this problem. I'm looking at other programmatic python based pdf report generators now. The Survey123 Report generator just may not be the right tool for this situation.

0 Kudos
Neal_t_k
Frequent Contributor

If you are doing python and stored your label, you could just set a script to periodically iterate trough your id column and update your label column based on your master list. 

0 Kudos
Neal_t_k
Frequent Contributor

@Trippetoe Is your id field in your feature layer have a coded domain? I wonder if jr:choice-name() would work, it couldn't hurt to try?  Then you would just have to update the label for the domain in your feature layer

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-xlsform-functions/...

or maybe if you just setup a domain for that field, this appears to say it pulls in the label instead of the name unless specified.

https://doc.arcgis.com/en/survey123/browser/analyze-results/featurereport-choice.htm

Trippetoe
Frequent Contributor

Hi @Neal_t_k 

 I've wandered pretty far down the 'roll-my-own-report-with-python' path. It's probably too far to back out of that path now 😉  Thanks again for all your help. 

0 Kudos