<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Choice_index is not defined in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/choice-index-is-not-defined/m-p/1122254#M38997</link>
    <description>&lt;P&gt;I am trying to use the formula here:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;jr:choice-name(selected-at(${select_multiple}, choice_index), '${select_multiple}')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To combine the labels from a select multiple into a new field. My exact calculation is here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;jr:choice-name(selected-at(${Photographers}, choice_index), '${Photographers}')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This previously worked in this survey before, it matches exactly the &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm" target="_self"&gt;Survey123 Formula Documentation&lt;/A&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the Survey123 app I receive the following error in the field this calculation is in:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ReferenceError: choice_index is not defined in expression: (Then lists the expression again here)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I know I can do a workaround with a series of concatenations and if statements, but this should work and has worked before. Just not sure what's going on here. Anybody else experiencing this?&lt;/P&gt;</description>
    <pubDate>Thu, 02 Dec 2021 16:56:21 GMT</pubDate>
    <dc:creator>CurtisDeVault</dc:creator>
    <dc:date>2021-12-02T16:56:21Z</dc:date>
    <item>
      <title>Choice_index is not defined</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/choice-index-is-not-defined/m-p/1122254#M38997</link>
      <description>&lt;P&gt;I am trying to use the formula here:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;jr:choice-name(selected-at(${select_multiple}, choice_index), '${select_multiple}')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To combine the labels from a select multiple into a new field. My exact calculation is here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;jr:choice-name(selected-at(${Photographers}, choice_index), '${Photographers}')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This previously worked in this survey before, it matches exactly the &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm" target="_self"&gt;Survey123 Formula Documentation&lt;/A&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the Survey123 app I receive the following error in the field this calculation is in:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ReferenceError: choice_index is not defined in expression: (Then lists the expression again here)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I know I can do a workaround with a series of concatenations and if statements, but this should work and has worked before. Just not sure what's going on here. Anybody else experiencing this?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 16:56:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/choice-index-is-not-defined/m-p/1122254#M38997</guid>
      <dc:creator>CurtisDeVault</dc:creator>
      <dc:date>2021-12-02T16:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Choice_index is not defined</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/choice-index-is-not-defined/m-p/1131924#M39624</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/254403"&gt;@CurtisDeVault&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the selected-at() function,&amp;nbsp;&lt;EM&gt;choice_index&lt;/EM&gt; must be an integer. From the&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm" target="_self"&gt;same documentation&lt;/A&gt;, the &lt;EM&gt;selected-at()&lt;/EM&gt; function "returns the name of the choice selected for the given number, counted starting from zero; for example, '2' will return the third selected choice." Note that the choice index can either be a number you specify in the expression, or a question placeholder, e.g.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;jr:choice-name(selected-at(${Photographers}, 4), '${Photographers}')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;jr:choice-name(selected-at(${Photographers}, ${choice_num}), '${Photographers}')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where &lt;EM&gt;${choice_num}&lt;/EM&gt; is an integer question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;jr:choice-name() function returns the label of &lt;STRONG&gt;one&lt;/STRONG&gt; choice only. So if you want to get the labels for all selected Photographers into one field, you'd need a separate jr:choice-name() expression for each selection. One way to do this could be to have a separate hidden question for each choice, then concatenate all these into a final question.&lt;/P&gt;&lt;P&gt;I will raise an issue to make the documentation clearer, as the descriptions for selected-at() and jr:choice-name() functions differ when referring to the choice index. Thanks for bring this to our attention!&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Best, Jim&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 03:41:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/choice-index-is-not-defined/m-p/1131924#M39624</guid>
      <dc:creator>Jim-Moore</dc:creator>
      <dc:date>2022-01-10T03:41:09Z</dc:date>
    </item>
  </channel>
</rss>

