<?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: Display IF yes domain (New to Arcade) in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062583#M40304</link>
    <description>&lt;P&gt;Is the layer public? I could pull it into a web map and make a similar attempt using the same data you're working with.&lt;/P&gt;</description>
    <pubDate>Thu, 27 May 2021 21:25:58 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-05-27T21:25:58Z</dc:date>
    <item>
      <title>Display IF yes domain (New to Arcade)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062287#M40286</link>
      <description>&lt;P&gt;Hello!&amp;nbsp; I have an AGOL hosted feature layer for park amenities.&amp;nbsp; Each amenity is in it's own field and each park that has any of the amenities, have been set with a domain of YES or NO.&amp;nbsp; I hope to be able to have the pop up show a simple list of the amenities that exist at each park but not the amenities that are not.&amp;nbsp; I then hope for people to be able to search for a park based on the amenities that they are interested in having access to.&lt;BR /&gt;&lt;BR /&gt;I was trying to use a tutorial that I found on YouTube but it didn't work for what I am trying to do.&amp;nbsp; Any feedback and advice would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Below is an example of what my data table looks like if that is helpful.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hherrmann_coj_0-1622123017415.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14346iDCA576D3DCCDA645/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hherrmann_coj_0-1622123017415.png" alt="hherrmann_coj_0-1622123017415.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 13:44:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062287#M40286</guid>
      <dc:creator>hherrmann_coj</dc:creator>
      <dc:date>2021-05-27T13:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Display IF yes domain (New to Arcade)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062309#M40291</link>
      <description>&lt;P&gt;There are a few ways you might tackle this. Considering you want to run a similar check for each attribute, it makes sense to use a loop here. We'll iterate over a feature's attributes, and if the value is "Yes", we'll add it to a string, then return the full string at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;var out_str = 'Amenities available:'

for (var attr in $feature){
    if ($feature[attr] == 'Yes'){
        out_str += `\n${attr}`
    }
}

return out_str&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Testing this against a sample feature as follows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1622124552142.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14353i1503FDC79E650FCE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1622124552142.png" alt="jcarlson_0-1622124552142.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;EDIT: I noticed your post referenced a domain. Just be sure that the if condition references the actual value, not the label, so "YES" or 1, or whatever you happen to be using.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:10:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062309#M40291</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-05-27T14:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Display IF yes domain (New to Arcade)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062346#M40292</link>
      <description>&lt;P&gt;Thank you so much Josh!&lt;BR /&gt;&lt;BR /&gt;So, this is what I have so far, however I seem to be missing something when it comes to returning the name of the field.&amp;nbsp; Ignorance is sometimes bliss, but sometimes it's not.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hherrmann_coj_0-1622128071335.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14363i6848FA6E69C39C8C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hherrmann_coj_0-1622128071335.png" alt="hherrmann_coj_0-1622128071335.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 15:08:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062346#M40292</guid>
      <dc:creator>hherrmann_coj</dc:creator>
      <dc:date>2021-05-27T15:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Display IF yes domain (New to Arcade)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062394#M40294</link>
      <description>&lt;P&gt;Oh, note that the added string is in &lt;STRONG&gt;backticks&lt;/STRONG&gt;, not single quotes. ` instead of '. It's next to the 1 key.&lt;/P&gt;&lt;P&gt;In Arcade, as in JavaScript, a backtick string allows you to access variables and other values within a ${...} inside of the string.&lt;/P&gt;&lt;P&gt;EDIT: You could also do &lt;STRONG&gt;out_str += '\n' + attr&lt;/STRONG&gt;. We want to add "attr" to the string, as that will reference the key (the attribute name) as opposed to its value.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 16:12:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062394#M40294</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-05-27T16:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Display IF yes domain (New to Arcade)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062551#M40303</link>
      <description>&lt;P&gt;So this isn't working for me.&amp;nbsp; Not sure what I'm doing wrong.&amp;nbsp; So I tried to do an IF/ELSE statement but that didn't work either.&amp;nbsp; I am horrible at stuff like this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 20:29:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062551#M40303</guid>
      <dc:creator>hherrmann_coj</dc:creator>
      <dc:date>2021-05-27T20:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Display IF yes domain (New to Arcade)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062583#M40304</link>
      <description>&lt;P&gt;Is the layer public? I could pull it into a web map and make a similar attempt using the same data you're working with.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 21:25:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/display-if-yes-domain-new-to-arcade/m-p/1062583#M40304</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-05-27T21:25:58Z</dc:date>
    </item>
  </channel>
</rss>

