<?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: Populate current field based on previous answer...sometimes in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/populate-current-field-based-on-previous-answer/m-p/737688#M1140</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the if() function must have both a value when true and a value when false, so you cannot accomplish this precise experience in a single question. &amp;nbsp;You&amp;nbsp;can create a similar experience:&lt;/P&gt;&lt;P&gt;1) Have your dropdown question (${DROPDOWN}) be relevant based on the value of ${CANNOT_LOCATE}. &amp;nbsp;The dropdown question will also have a bind::esri:esriFieldType of null (it's a visual element; the data is stored in the next question).&lt;/P&gt;&lt;P&gt;2) Have a calculate question store the answer with the formula to evaluate:&lt;/P&gt;&lt;P&gt;if(selected(${CANNOT_LOCATE}, 'YES'), 'UNKNOWN',&amp;nbsp;${DROPDOWN})&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2018 23:23:17 GMT</pubDate>
    <dc:creator>JamesTedrick</dc:creator>
    <dc:date>2018-05-04T23:23:17Z</dc:date>
    <item>
      <title>Populate current field based on previous answer...sometimes</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/populate-current-field-based-on-previous-answer/m-p/737687#M1139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.esri.com/migrated-users/3263"&gt;James Tedrick&lt;/A&gt;‌, &lt;A href="https://community.esri.com/migrated-users/3966"&gt;Ismael Chivite&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;I am attempting to create the following calculation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If the value of {CANNOT_LOCATE} is set to 'YES' then set my current field to 'UNKNOWN'.&lt;/LI&gt;&lt;LI&gt;If&amp;nbsp;&lt;SPAN&gt;the value of {CANNOT_LOCATE} is set to 'NO' then&amp;nbsp;don't pre-populate my current field and let the user choose from&amp;nbsp;the list of choices.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I can achieve the first part using:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="text-align: center;"&gt;&lt;EM&gt;if(selected(${CANNOT_LOCATE}, 'YES'), 'UNKNOWN',''&lt;/EM&gt;)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, if the value of&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;{CANNOT_LOCATE} is set to 'NO' the value chosen for my current field is considered ineligible and gets the strike through as it's not ' '. So, I tried the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;if(selected(${CANNOT_LOCATE}, 'YES'), 'UNKNOWN',if(selected(${CANNOT_LOCATE}, 'NO'),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&lt;EM&gt;'NO',''))&lt;/EM&gt;&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This works, and even if I change my current fields value from "NO" to something else on the choice list it's accepted. However, it &lt;EM&gt;does&lt;/EM&gt; pre-populate my current field with a "NO" meaning a user could technically skip over this field. I'd much prefer to leave my current field BLANK if&amp;nbsp;&lt;SPAN&gt;the value of {CANNOT_LOCATE} is set to 'NO'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any advice?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 16:21:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/populate-current-field-based-on-previous-answer/m-p/737687#M1139</guid>
      <dc:creator>AndrewHargreaves2</dc:creator>
      <dc:date>2018-05-03T16:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Populate current field based on previous answer...sometimes</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/populate-current-field-based-on-previous-answer/m-p/737688#M1140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the if() function must have both a value when true and a value when false, so you cannot accomplish this precise experience in a single question. &amp;nbsp;You&amp;nbsp;can create a similar experience:&lt;/P&gt;&lt;P&gt;1) Have your dropdown question (${DROPDOWN}) be relevant based on the value of ${CANNOT_LOCATE}. &amp;nbsp;The dropdown question will also have a bind::esri:esriFieldType of null (it's a visual element; the data is stored in the next question).&lt;/P&gt;&lt;P&gt;2) Have a calculate question store the answer with the formula to evaluate:&lt;/P&gt;&lt;P&gt;if(selected(${CANNOT_LOCATE}, 'YES'), 'UNKNOWN',&amp;nbsp;${DROPDOWN})&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 23:23:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/populate-current-field-based-on-previous-answer/m-p/737688#M1140</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-05-04T23:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Populate current field based on previous answer...sometimes</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/populate-current-field-based-on-previous-answer/m-p/737689#M1141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3263"&gt;James Tedrick&lt;/A&gt;‌ I was unable to include the &lt;SPAN&gt;${DROPDOWN})&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;in a calculation without getting an error. Instead I added 'PLEASE_ANSWER' to each of my choice lists and calculated that to be the default answer. It's a bit of a pain as it's now a possible answer a user can choose and so now I must also include a constraint for each question stating that&amp;nbsp;&lt;SPAN&gt;${DROPDOWN}!='PLEASE_ANSWER'.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 15:14:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/populate-current-field-based-on-previous-answer/m-p/737689#M1141</guid>
      <dc:creator>AndrewHargreaves2</dc:creator>
      <dc:date>2018-08-13T15:14:10Z</dc:date>
    </item>
  </channel>
</rss>

