<?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: Multiple Choice Constraint - A List of values in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819253#M15376</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3263"&gt;James Tedrick&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;I'm following the above logic, but getting nothing. Here's my constraint statement in my [COVER_LEVEL] row:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;if(selected(${COVERED_OVER}, 'NO'), selected(${COVER_LEVEL},'UNKNOWN'), true)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I set&amp;nbsp;{COVERED_OVER}= 'NO'&amp;nbsp;and ${COVER_LEVEL}= 'UNKNOWN' my message fails to appear. Any advice is gratefully received.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Aug 2018 12:48:52 GMT</pubDate>
    <dc:creator>AndrewHargreaves2</dc:creator>
    <dc:date>2018-08-10T12:48:52Z</dc:date>
    <item>
      <title>Multiple Choice Constraint - A List of values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819251#M15374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Regarding Ishmael's post on &lt;A _jive_internal="true" href="https://community.esri.com/groups/survey123/blog/2017/08/30/understanding-multiple-choice-questions-in-survey123-for-arcgis"&gt;Multiple Choice questions&lt;/A&gt;, I see the ability to review individual items within a&amp;nbsp;select_multiple type;&amp;nbsp;is it possible to review if a list of items are selected?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a client who is observing activities, and which observed activities are unsafe, both fields reference the same choice list.&amp;nbsp; I'd like to add a constraint that ensures that if a item is selected in the 'unsafe' field it is also selected in the 'observed' field.&amp;nbsp; Can something along these lines be done?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE width="1056"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="background: #9bbb59; border-width: 0.5pt 0px 0px 0.5pt; border-style: solid none none solid; border-color: #9bbb59 white white #9bbb59; text-decoration: none;" width="183"&gt;type&lt;/TD&gt;&lt;TD style="background: #9bbb59; border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 white white; text-decoration: none;" width="96"&gt;name&lt;/TD&gt;&lt;TD style="background: #9bbb59; border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 white white; text-decoration: none;" width="151"&gt;label&lt;/TD&gt;&lt;TD style="background: #9bbb59; border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 white white; text-decoration: none;" width="269"&gt;constraint&lt;/TD&gt;&lt;TD style="background: #9bbb59; border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 white white; text-decoration: none;" width="357"&gt;constraint_message&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-width: 0.5pt 0px 0px 0.5pt; border-style: solid none none solid; border-color: #9bbb59 black black #9bbb59; font-weight: 400; text-decoration: none; background-color: transparent;"&gt;select_multiple Activities&lt;/TD&gt;&lt;TD style="border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 black black; font-weight: 400; text-decoration: none; background-color: transparent;"&gt;observed&lt;/TD&gt;&lt;TD style="border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 black black; font-weight: 400; text-decoration: none; background-color: transparent;" width="151"&gt;Observed Activities&lt;/TD&gt;&lt;TD style="border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 black black; font-weight: 400; text-decoration: none; background-color: transparent;"&gt;&lt;/TD&gt;&lt;TD style="border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 black black; font-weight: 400; text-decoration: none; background-color: transparent;" width="357"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-width: 0.5pt 0px 0px 0.5pt; border-style: solid none none solid; border-color: #9bbb59 black black #9bbb59; font-weight: 400; text-decoration: none; background-color: transparent;"&gt;select_multiple Activities&lt;/TD&gt;&lt;TD style="border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 black black; font-weight: 400; text-decoration: none; background-color: transparent;"&gt;unsafe&lt;/TD&gt;&lt;TD style="border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 black black; font-weight: 400; text-decoration: none; background-color: transparent;" width="151"&gt;Unsafe Activities&lt;/TD&gt;&lt;TD style="border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 black black; font-weight: 400; text-decoration: none; background-color: transparent;"&gt;selected(${observed}, ${unsafe} )&lt;/TD&gt;&lt;TD style="border-width: 0.5pt 0px 0px; border-style: solid none none; border-color: #9bbb59 black black; font-weight: 400; text-decoration: none; background-color: transparent;" width="357"&gt;Unsafe Activities must also be noted as Observed above&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Sep 2017 16:40:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819251#M15374</guid>
      <dc:creator>PaulSchneider</dc:creator>
      <dc:date>2017-09-26T16:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Choice Constraint - A List of values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819252#M15375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that this is possible, but a bit more complicated. &amp;nbsp;The basic unit of the constraint check is&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For a given value, is it selected in observed? &amp;nbsp;If so, is it selected in unsafe?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This translates to the following in XLSForm formulas:&lt;/P&gt;&lt;PRE&gt;if(selected(${observed}, 'a'), selected(${unsafe},'a'), true)&lt;/PRE&gt;&lt;P&gt;if( observed has the value a selected, then determine&amp;nbsp;if unsafe selects value a, otherwise the constraint is met)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would repeat this for each value in the list, joining the parts to gather with 'and' so that if one is not met, the entire thing false:&lt;/P&gt;&lt;PRE&gt;if(selected(${observed}, 'a'), selected(${unsafe},'a'), true) and if(selected(${observed}, 'b'), selected(${unsafe},'b'), true) and ...&lt;/PRE&gt;&lt;P&gt;Note this is to ensure that if it has been selected in observed, that it appears in unsafe- this would let unsafe have additional values that are not selected in observed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Sep 2017 17:52:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819252#M15375</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-09-26T17:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Choice Constraint - A List of values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819253#M15376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3263"&gt;James Tedrick&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;I'm following the above logic, but getting nothing. Here's my constraint statement in my [COVER_LEVEL] row:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;if(selected(${COVERED_OVER}, 'NO'), selected(${COVER_LEVEL},'UNKNOWN'), true)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I set&amp;nbsp;{COVERED_OVER}= 'NO'&amp;nbsp;and ${COVER_LEVEL}= 'UNKNOWN' my message fails to appear. Any advice is gratefully received.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 12:48:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819253#M15376</guid>
      <dc:creator>AndrewHargreaves2</dc:creator>
      <dc:date>2018-08-10T12:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Choice Constraint - A List of values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819254#M15377</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;This is on a constraint, correct? &amp;nbsp;The formula you have translates to:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If covered_over is no, cover_level must be UNKNOWN; if covered_over is not no, any value is valid&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you you want unknown to not be a valid answer when covered_over is no, you would want:&lt;/P&gt;&lt;P&gt;if(selected(${covered_over}, 'no'), not(selected(${cover_level}, 'unknown')), true)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 15:21:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819254#M15377</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-08-10T15:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Choice Constraint - A List of values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819255#M15378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more for you &lt;A href="https://community.esri.com/migrated-users/3263"&gt;James Tedrick&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can the logic you describe above for&amp;nbsp; the orginal questions contain an 'or'? Sadly, it appears not as I'm trying the below with no success:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;if(selected(${COVERED_OVER}, 'NO'), not(selected(${COVER_LEVEL}, 'UNKNOWN')), true) or if(selected(${COVERED_OVER}, 'UNKNOWN'), not(selected(${COVER_LEVEL}, 'BELOW_GRADE')), true)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The first part, before the 'or', works fine upon validation however the second half of the statement is failing to do anything.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 16:41:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819255#M15378</guid>
      <dc:creator>AndrewHargreaves2</dc:creator>
      <dc:date>2018-08-10T16:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Choice Constraint - A List of values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819256#M15379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joining two constraints together, you probably want to use 'and' instead of or. &amp;nbsp;and will require both statements to be true for the answer to be valid, or will require one of the statements to be true:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; width: 49.87468671679198%;"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef;"&gt;&lt;TH style="width: 40.5264483627204%;"&gt;Statement (expression1 __ expression2)&lt;/TH&gt;&lt;TH style="width: 11.473551637279597%;"&gt;Result&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="width: 40.5264483627204%;"&gt;true and true&lt;/TD&gt;&lt;TD style="width: 11.473551637279597%;"&gt;true&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 40.5264483627204%;"&gt;true and false&lt;/TD&gt;&lt;TD style="width: 11.473551637279597%;"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 40.5264483627204%;"&gt;false and true&lt;/TD&gt;&lt;TD style="width: 11.473551637279597%;"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 40.5264483627204%;"&gt;false and false&lt;/TD&gt;&lt;TD style="width: 11.473551637279597%;"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 40.5264483627204%;"&gt;true or true&lt;/TD&gt;&lt;TD style="width: 11.473551637279597%;"&gt;&lt;P&gt;true&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 40.5264483627204%;"&gt;true or false&lt;/TD&gt;&lt;TD style="width: 11.473551637279597%;"&gt;&lt;P&gt;true&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 40.5264483627204%;"&gt;false or true&lt;/TD&gt;&lt;TD style="width: 11.473551637279597%;"&gt;&lt;P&gt;true&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 40.5264483627204%;"&gt;false or false&lt;/TD&gt;&lt;TD style="width: 11.473551637279597%;"&gt;&lt;P&gt;false&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 16:52:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819256#M15379</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-08-10T16:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Choice Constraint - A List of values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819257#M15380</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;‌ that's just my point; If &lt;STRONG&gt;&lt;EM&gt;either&lt;/EM&gt; &lt;/STRONG&gt;statement is TRUE then the constraint is also TRUE. For example:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;if(selected(${COVERED_OVER}, 'NO'), not(selected(${COVER_LEVEL}, 'UNKNOWN')), true) or if(selected(${COVERED_OVER}, 'UNKNOWN'), not(selected(${COVER_LEVEL}, 'BELOW_GRADE')), true)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;should result in a constrain triggering:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; border: 0px;"&gt;if COVERED_OVER&amp;nbsp;is NO, COVER_LEVEL must NOT be UNKNOWN&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; border: 0px;"&gt;or&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; border: 0px;"&gt;if COVERED_OVER&amp;nbsp;is UNKNOWN, &lt;EM style="background-color: #ffffff; border: 0px;"&gt;COVER_LEVEL&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;must NOT be&amp;nbsp;BELOW_GRADE&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; border: 0px;"&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;However, as described only the statement before the 'or' works to trigger the constraint....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 17:38:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819257#M15380</guid>
      <dc:creator>AndrewHargreaves2</dc:creator>
      <dc:date>2018-08-13T17:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Choice Constraint - A List of values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819258#M15381</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;You're actually wanting the reverse - constraints fire when a statement evaluates as FALSE (that's why there's not() in the function I created - to flip it to a "can't be &amp;lt;value&amp;gt;"). &amp;nbsp;You do want to use 'and' (all the requirements must be met) instead of 'or' (one of the requirements must be met). &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR is&amp;nbsp;a little confusing because it strays a bit from conversational English:&lt;/P&gt;&lt;P&gt;Q: Do you want&amp;nbsp;to go out for dinner or cook at&amp;nbsp;home?&amp;nbsp;&lt;/P&gt;&lt;P&gt;A: Yes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 20:43:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819258#M15381</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-08-13T20:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Choice Constraint - A List of values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819259#M15382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://community.esri.com/migrated-users/3263"&gt;James Tedrick&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;#SyntaxKing!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2018 12:22:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-choice-constraint-a-list-of-values/m-p/819259#M15382</guid>
      <dc:creator>AndrewHargreaves2</dc:creator>
      <dc:date>2018-08-14T12:22:58Z</dc:date>
    </item>
  </channel>
</rss>

