<?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: Can you use an Arcade field in a hosted layer's filter? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/1280952#M51606</link>
    <description>&lt;P&gt;Thanks, Steve--I was reluctant to edit the json, but it got me the exact result I wanted in my web map. I was careful to document the edit in the AGOL description field for the web map for future reference.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 18:47:00 GMT</pubDate>
    <dc:creator>ZakBaron</dc:creator>
    <dc:date>2023-04-20T18:47:00Z</dc:date>
    <item>
      <title>Can you use an Arcade field in a hosted layer's filter?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104562#M4982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working in Portal and have a hosted layer that has an integer field which represents a given calendar year.I recently realized there are some features where the value in this field represent previous years so I want to exclude them from my map using a filter. Arcade generated fields are recognized in both the symbology and pop up dialogs but they are not visible in the layer's filter dialog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the case? Are you not able to utilize an Arcade calculated field within the filter dialog? To be perfectly clear, this is the dialog I'm referring to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/475585_agol_filter_arcade_field.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2019 21:56:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104562#M4982</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2019-12-06T21:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use an Arcade field in a hosted layer's filter?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104563#M4983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/23538" target="_blank"&gt;Steve Cole&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hate to tell you, but at this moment you cannot use arcade "virtual fields" in a filter expression. It would be nice to have and users have be asking for the functionality:&amp;nbsp;&lt;A href="https://community.esri.com/ideas/15619" target="_blank"&gt;https://community.esri.com/ideas/15619&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jun 2021 08:20:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104563#M4983</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-06-22T08:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use an Arcade field in a hosted layer's filter?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104564#M4984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, yeah, that would be ideal. I think I'll be able to handle my current situation using the trick of using AGO Assistant to tweak the underlying SQL query string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks-&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2019 15:57:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104564#M4984</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2019-12-09T15:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use an Arcade field in a hosted layer's filter?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104565#M4985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Were you successful in tweaking the query in AGO Assistant? If so, pointers?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2020 21:44:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104565#M4985</guid>
      <dc:creator>DanteLee</dc:creator>
      <dc:date>2020-06-08T21:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use an Arcade field in a hosted layer's filter?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104566#M4986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0px; padding: 0px; overflow-wrap: break-word; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;Dante-&lt;/P&gt;&lt;P style="margin: 0px; padding: 0px; overflow-wrap: break-word; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; padding: 0px; overflow-wrap: break-word; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;Yes, it was fairly straightforward. Open up AGO Assistant and then navigate to your webmap of interest and chose "View an items JSON" from the "I Want to..." menu. The second "block" of JSON code details with the layers in the webmap. Scroll through it until you find the layer you need to tweak. Once you find the layer, you'll want to zero in on the DefinitionExpression property. Here's what it looks like in my edited webmap:&lt;/P&gt;&lt;P style="margin: 0px; padding: 0px; overflow-wrap: break-word; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; padding: 0px; overflow-wrap: break-word; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/495973_ago_definition_expression.jpg" /&gt;&lt;/P&gt;&lt;P style="margin: 0px; padding: 0px; overflow-wrap: break-word; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; padding: 0px; overflow-wrap: break-word; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;The later half of the definitionExpression sets the criteria for a date between the current year and 12 years from now. The above expression is based on an actual date field but you could also do the same thing with a text based field as well. Originally, the data I was provided had the 4 digit year stored as text. Here's the same definition but for a text based field:&lt;/P&gt;&lt;P style="margin: 0px; padding: 0px; overflow-wrap: break-word; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;"((M8UpgradeBy = 'Transition Plan') OR (M8UpgradeBy = 'Capital Project') OR (M8UpgradeBy = 'Overlay Program')) AND (m9upgradeyr &amp;gt;= EXTRACT(YEAR FROM CURRENT_DATE()) ) AND (m9upgradeyr &amp;lt;= EXTRACT(YEAR FROM CURRENT_DATE()) + 12 )"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While the version based on the text year field worked for display purposes, I had to change the underlying data to be a date field because the date slider widget I was using in WebApp Builder wasn't honoring the query expression. Once I changed it to hit an actual date field, all was well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2020 23:08:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104566#M4986</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2020-06-08T23:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use an Arcade field in a hosted layer's filter?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104567#M4987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah! Thanks for the thorough response. I have some use cases for this, but not what inspired my initial search. I was hoping I could've referenced the Arcade field in this backend workaround. I did a point-poly intersection via an Arcade expression, and I'm looking to filter out the point if its corresponding poly was also filtered out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2020 23:19:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/104567#M4987</guid>
      <dc:creator>DanteLee</dc:creator>
      <dc:date>2020-06-08T23:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use an Arcade field in a hosted layer's filter?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/1280952#M51606</link>
      <description>&lt;P&gt;Thanks, Steve--I was reluctant to edit the json, but it got me the exact result I wanted in my web map. I was careful to document the edit in the AGOL description field for the web map for future reference.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 18:47:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-you-use-an-arcade-field-in-a-hosted-layer-s/m-p/1280952#M51606</guid>
      <dc:creator>ZakBaron</dc:creator>
      <dc:date>2023-04-20T18:47:00Z</dc:date>
    </item>
  </channel>
</rss>

