Hi, I am looking for a way to retain both the text name of a field select_one choice, as well as the geopoint information for the choice.
I'm using the 'Calculations on Geopoints' method in my xlsform, which uses geopoints in the name column.
The fields in the xlsform look like the below:
My choices list for the fields look like this:
I am wanting to have my survey output datasheet include the label somehow, so that I can make charts on the Dashboard using the text label names (e.g. Site A, Building 1 etc). However obviously since the name column is what is shown in the output datasheet, all I see in the datasheet is the geopoint information.
Is there a way to set up a separate hidden field somehow to pull the labels rather than the name?
Solved! Go to Solution.
Hi @JulietK the label for a choice can be retrieved using the jr:choice-name() function, as shown in the table of supported functions in the Formulas documentation. Please also refer to this note in the Cascading and external selects documentation.
For example, for the Workarea select_one question, you could store the label in another question using a calculation like:
jr:choice-name(${Workarea}, '${Workarea}')
Hope this helps. Best, Jim
Hi @JulietK the label for a choice can be retrieved using the jr:choice-name() function, as shown in the table of supported functions in the Formulas documentation. Please also refer to this note in the Cascading and external selects documentation.
For example, for the Workarea select_one question, you could store the label in another question using a calculation like:
jr:choice-name(${Workarea}, '${Workarea}')
Hope this helps. Best, Jim
Hi Jim,
Perfect, thank you so much!
Quick question, would the jr:choice-name() function work within a if(selected()) formula? For example, if I had 2 separate fields Workarea1 and Workarea2 (only one of either are available in a survey depending on previous selections, both are set as bind::esri:fieldType null), and I wanted to pull only the labels into one single field?
e.g. if(selected(${previousfield}, 'choice1'),jr:choice-name(${Workarea1}, '${Workarea1}'),jr:choice-name(${Workarea2}, '${Workarea2}'))