<?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 Arcade Conditional Visibility Statement Help in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-conditional-visibility-statement-help/m-p/1096186#M1661</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Still working with Arcade here and there - trying to get some Field Maps configured with conditional visibility similar to Relevant fields in forms used in Survey123 but I'm quite a newbie to Arcade.&lt;/P&gt;&lt;P&gt;I've managed to get conditional visibility working for single values so that a field won't appear if a specific value is selected in a previous field. Ex: $feature.name == 'value'.&lt;/P&gt;&lt;P&gt;How would that work for a number of options? Say I wanted to restrict the field from appearing in the form for values "a, b, c" OR 'd" entered in a previous field?&lt;/P&gt;&lt;P&gt;I suspect it would use If-Else, but I don't want the field to populate with another value - I just don't want it to appear!&lt;/P&gt;&lt;P&gt;Maybe I'm overthinking it . . .&lt;/P&gt;</description>
    <pubDate>Wed, 08 Sep 2021 00:30:08 GMT</pubDate>
    <dc:creator>Henry</dc:creator>
    <dc:date>2021-09-08T00:30:08Z</dc:date>
    <item>
      <title>Arcade Conditional Visibility Statement Help</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-conditional-visibility-statement-help/m-p/1096186#M1661</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Still working with Arcade here and there - trying to get some Field Maps configured with conditional visibility similar to Relevant fields in forms used in Survey123 but I'm quite a newbie to Arcade.&lt;/P&gt;&lt;P&gt;I've managed to get conditional visibility working for single values so that a field won't appear if a specific value is selected in a previous field. Ex: $feature.name == 'value'.&lt;/P&gt;&lt;P&gt;How would that work for a number of options? Say I wanted to restrict the field from appearing in the form for values "a, b, c" OR 'd" entered in a previous field?&lt;/P&gt;&lt;P&gt;I suspect it would use If-Else, but I don't want the field to populate with another value - I just don't want it to appear!&lt;/P&gt;&lt;P&gt;Maybe I'm overthinking it . . .&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 00:30:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-conditional-visibility-statement-help/m-p/1096186#M1661</guid>
      <dc:creator>Henry</dc:creator>
      <dc:date>2021-09-08T00:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Conditional Visibility Statement Help</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-conditional-visibility-statement-help/m-p/1096224#M1663</link>
      <description>&lt;P&gt;You can combine multiple conditions with an AND or OR statement as in SQL. You do this in the case of Arcade with a double &amp;amp;&amp;amp; for AND and a double || for OR.&lt;/P&gt;&lt;P&gt;Example AND: if($feature.field1 == "a" &amp;amp;&amp;amp; $feature.field2 == "b" &amp;amp;&amp;amp; $feature.field3 == "c")&lt;/P&gt;&lt;P&gt;Example OR: if($feature.field == "a" || $feature.field == "b" || $feature.field == "c")&lt;/P&gt;&lt;P&gt;Example combination: if($feature.field1 == "a" &amp;amp;&amp;amp; $feature.field2 == "b" || $feature.field1 == "c" &amp;amp;&amp;amp; $feature.field2 == "d")&lt;/P&gt;&lt;P&gt;Hopefully you get on with this. Good luck!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 03:31:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-conditional-visibility-statement-help/m-p/1096224#M1663</guid>
      <dc:creator>Ewout_de_Graaff</dc:creator>
      <dc:date>2021-09-08T03:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Conditional Visibility Statement Help</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-conditional-visibility-statement-help/m-p/1096355#M1666</link>
      <description>&lt;P&gt;Check out the function &lt;A href="https://developers.arcgis.com/arcade/function-reference/data_functions/#includes" target="_blank"&gt;Includes&lt;/A&gt;. If you define a list of values, you can use this to return a boolean true/false.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var restricted_list = ['a', 'b', 'c', 'd']
var prev_field = $feature['field_name']

// Will return 'true' if previous field is in restricted list
return Includes(restricted_list, prev_field)&lt;/LI-CODE&gt;&lt;P&gt;It may make more intuitive sense to equate "true" with "visible", though, so you can simply re-write that with an added &lt;STRONG&gt;!&lt;/STRONG&gt;, which negates whatever comes after it.&lt;/P&gt;&lt;PRE&gt;!Includes(...)&lt;/PRE&gt;&lt;P&gt;Which will return "true" if the previous field is&amp;nbsp;&lt;EM&gt;not&lt;/EM&gt; in the restricted list.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 13:41:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-conditional-visibility-statement-help/m-p/1096355#M1666</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-09-08T13:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Conditional Visibility Statement Help</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-conditional-visibility-statement-help/m-p/1096491#M1667</link>
      <description>&lt;P&gt;Thanks for the tips, both! Tried the methods out and they're working great.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 17:39:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-conditional-visibility-statement-help/m-p/1096491#M1667</guid>
      <dc:creator>Henry</dc:creator>
      <dc:date>2021-09-08T17:39:55Z</dc:date>
    </item>
  </channel>
</rss>

