<?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 Re: Calculation syntax to return specific value for a select_one question, dependent on a text question in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-syntax-to-return-specific-value-for-a/m-p/1049455#M34016</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/96317"&gt;@JulietK&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;This is possible using an &lt;EM&gt;if()&lt;/EM&gt; statement in the calculation column of the select one. For example, based on your screenshot above:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(${code}='&lt;SPAN&gt;NO ITEM ASSOCIATED&lt;/SPAN&gt;','nocompany','')&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This will select the &lt;EM&gt;nocompany&lt;/EM&gt; choice when the exact string in the text field equals&amp;nbsp;&lt;EM&gt;NO ITEM ASSOCIATED&lt;/EM&gt;, but if the string is anything else, the calculation will set the value as null, so then the user can choose any value from the dropdown. Is this what you are after?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phil.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Apr 2021 04:04:40 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-04-21T04:04:40Z</dc:date>
    <item>
      <title>Calculation syntax to return specific value for a select_one question, dependent on a text question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-syntax-to-return-specific-value-for-a/m-p/1049452#M34013</link>
      <description>&lt;P&gt;Hi, I am struggling with the below-&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wanting a specific value to pop up as default, if a previous text question is answered with a specific text.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JulietK_0-1618976042515.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/11395iD8D8CE5604932123/image-size/large?v=v2&amp;amp;px=999" role="button" title="JulietK_0-1618976042515.png" alt="JulietK_0-1618976042515.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JulietK_1-1618976103946.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/11396i0E67817A9CDDE0CD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JulietK_1-1618976103946.png" alt="JulietK_1-1618976103946.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I would like 'Manufacture Company' to field to return the 'nocompany' selection option automatically (without the survey user having to manually select this option), if the value 'NO ITEM ASSOCIATED' is entered into the text field 'Item Code', but otherwise leave blank (for the user to manually select).&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far the syntax examples I've found have been only for return value depending on value from a select_one/select_multiple question, or only for integer-related entries.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice would be greatly appreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 03:39:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-syntax-to-return-specific-value-for-a/m-p/1049452#M34013</guid>
      <dc:creator>JulietK</dc:creator>
      <dc:date>2021-04-21T03:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation syntax to return specific value for a select_one question, dependent on a text question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-syntax-to-return-specific-value-for-a/m-p/1049455#M34016</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/96317"&gt;@JulietK&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;This is possible using an &lt;EM&gt;if()&lt;/EM&gt; statement in the calculation column of the select one. For example, based on your screenshot above:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(${code}='&lt;SPAN&gt;NO ITEM ASSOCIATED&lt;/SPAN&gt;','nocompany','')&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This will select the &lt;EM&gt;nocompany&lt;/EM&gt; choice when the exact string in the text field equals&amp;nbsp;&lt;EM&gt;NO ITEM ASSOCIATED&lt;/EM&gt;, but if the string is anything else, the calculation will set the value as null, so then the user can choose any value from the dropdown. Is this what you are after?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phil.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 04:04:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-syntax-to-return-specific-value-for-a/m-p/1049455#M34016</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-04-21T04:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation syntax to return specific value for a select_one question, dependent on a text question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-syntax-to-return-specific-value-for-a/m-p/1049457#M34017</link>
      <description>&lt;P&gt;Hi Philip,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perfect, thank you so much! Looks like I've been missing the apostrophes in the last section of the syntax &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 04:10:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-syntax-to-return-specific-value-for-a/m-p/1049457#M34017</guid>
      <dc:creator>JulietK</dc:creator>
      <dc:date>2021-04-21T04:10:19Z</dc:date>
    </item>
  </channel>
</rss>

