<?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: Survey123 If/Then relevant question in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/survey123-if-then-relevant-question/m-p/858789#M25282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be done in a few ways. &amp;nbsp;As you mention above, you could nest a series of if statements to evaluate whether &amp;nbsp;'yes' is selected. &amp;nbsp;In this case, because you only need to identify the presence of one 'yes', I might suggest concatenating the questions together and using a regex to find the value 'yes' (or whatever the yes value is), and then using it in an if statement to set yes or no:&lt;/P&gt;&lt;P&gt;if(regex(concat(${q1},&amp;nbsp;&lt;SPAN&gt;${q2},&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;${q3},&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;${q4},&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;${q5},&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;${q6},&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;${q7}), '^.*yes.*$'), 'yes', 'no')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Feb 2018 20:30:45 GMT</pubDate>
    <dc:creator>JamesTedrick</dc:creator>
    <dc:date>2018-02-23T20:30:45Z</dc:date>
    <item>
      <title>Survey123 If/Then relevant question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/survey123-if-then-relevant-question/m-p/858788#M25281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a survey under construction that has multiple select_one yes_no questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Is there this thing present? Y/N&lt;/LI&gt;&lt;LI&gt;Is there this other thing present? Y/N&lt;/LI&gt;&lt;LI&gt;What about this thing? Y/N&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;etc....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to have a final field that is triggered for follow up.&amp;nbsp;&lt;/P&gt;&lt;P&gt;"If any question 1-7 above was answered Yes, then follow up is required and it needs to default as yes."&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently have it set up as a relevant question, but would rather have it autopopulate to "yes" and have it read only.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've poured over the other if/then questions on the forum# and cant' seem to find a solution.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 18:59:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/survey123-if-then-relevant-question/m-p/858788#M25281</guid>
      <dc:creator>JohnWalls2</dc:creator>
      <dc:date>2018-02-23T18:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Survey123 If/Then relevant question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/survey123-if-then-relevant-question/m-p/858789#M25282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be done in a few ways. &amp;nbsp;As you mention above, you could nest a series of if statements to evaluate whether &amp;nbsp;'yes' is selected. &amp;nbsp;In this case, because you only need to identify the presence of one 'yes', I might suggest concatenating the questions together and using a regex to find the value 'yes' (or whatever the yes value is), and then using it in an if statement to set yes or no:&lt;/P&gt;&lt;P&gt;if(regex(concat(${q1},&amp;nbsp;&lt;SPAN&gt;${q2},&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;${q3},&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;${q4},&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;${q5},&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;${q6},&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;${q7}), '^.*yes.*$'), 'yes', 'no')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 20:30:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/survey123-if-then-relevant-question/m-p/858789#M25282</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-02-23T20:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Survey123 If/Then relevant question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/survey123-if-then-relevant-question/m-p/858790#M25283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;I need to do this as well, but instead of a series of questions, I have a Yes/No question in a repeat ${CaptureYN}.&amp;nbsp; If the answer is ever "Yes" to ${CaptureYN}, I want to make the answer to a select_one yes/no question named ${SubmitSnake} Yes.&amp;nbsp; Will this work for a question in a repeat?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(regex(concat(${CaptureYN}, '^.*Yes.*$'), 'Yes', 'No'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try this calculation, I get an error that it "cannot handle function 'if'. Requires 3 arguments. Only 1 provided.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2019 14:44:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/survey123-if-then-relevant-question/m-p/858790#M25283</guid>
      <dc:creator>Peters_Amy</dc:creator>
      <dc:date>2019-02-05T14:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Survey123 If/Then relevant question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/survey123-if-then-relevant-question/m-p/858791#M25284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the placement of the parenthesis- you should have 2 at the end of the regex. &amp;nbsp;Instead of the concat(), I would suggest the sum() function, which will concatenate strings from a repeat in the app. &amp;nbsp;Also, check if you are storing 'Yes' or 'yes' (in fact, given this is yes/no, you could just check for 'y', 'e', or 's').&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2019 19:03:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/survey123-if-then-relevant-question/m-p/858791#M25284</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2019-02-05T19:03:43Z</dc:date>
    </item>
  </channel>
</rss>

