<?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: related data Arcade expression in layer style in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/related-data-arcade-expression-in-layer-style/m-p/1560720#M62491</link>
    <description>&lt;P&gt;ok, thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/17874"&gt;@RussRoberts&lt;/a&gt;!&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2024 14:13:53 GMT</pubDate>
    <dc:creator>HelenCooper</dc:creator>
    <dc:date>2024-11-20T14:13:53Z</dc:date>
    <item>
      <title>related data Arcade expression in layer style</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/related-data-arcade-expression-in-layer-style/m-p/1560666#M62485</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been using this incredibly helpful post (&lt;A href="https://community.esri.com/t5/arcgis-online-blog/show-related-data-or-tables-in-pop-ups-with-arcade/bc-p/1560662#M1204" target="_blank"&gt;https://community.esri.com/t5/arcgis-online-blog/show-related-data-or-tables-in-pop-ups-with-arcade/bc-p/1560662#M1204&lt;/A&gt;) to get my pop-up to show data from a related feature layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My expression looks like this:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;//Access 'Facilities' table as a featureset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;portal&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Portal&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"https://www.arcgis.com"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;facilities&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByPortalItem&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;portal&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"1e189022e7064e0e9b1bdaadef6d3b78"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Filter related features by Site ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;varSite&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;siteid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;filterStatement&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;'siteid = @varSite'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//related features as a variable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;relatedData&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;facilities&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;filterStatement&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Sort related features &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;relatedDataSorted&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Orderby&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;relatedData&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'facilitytype ASC'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;popupString&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;''&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;facilityCount&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;f&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;relatedDataSorted&lt;/SPAN&gt;&lt;SPAN&gt;){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;popupString&lt;/SPAN&gt;&lt;SPAN&gt; += &lt;/SPAN&gt;&lt;SPAN&gt;Text&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;facilitytype&lt;/SPAN&gt;&lt;SPAN&gt;) + &lt;/SPAN&gt;&lt;SPAN&gt;TextFormatting&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;NewLine&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;facilityCount&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;facilityCount&lt;/SPAN&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;popupString&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This works great within the pop-up, but I'm now trying to extend it to the style of the layer, so that I can vary the size of the point depending on the 'Count' (i.e. number of related features).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;At the moment the code doesn't work at all in the style expression builder - can anyone suggest where I'm going wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Nov 2024 11:49:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/related-data-arcade-expression-in-layer-style/m-p/1560666#M62485</guid>
      <dc:creator>HelenCooper</dc:creator>
      <dc:date>2024-11-20T11:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: related data Arcade expression in layer style</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/related-data-arcade-expression-in-layer-style/m-p/1560699#M62489</link>
      <description>&lt;P&gt;Currently styling against related records is not supported at this time. It would be a pretty expensive operation to run the expression on each pan/zoom.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 13:44:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/related-data-arcade-expression-in-layer-style/m-p/1560699#M62489</guid>
      <dc:creator>RussRoberts</dc:creator>
      <dc:date>2024-11-20T13:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: related data Arcade expression in layer style</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/related-data-arcade-expression-in-layer-style/m-p/1560720#M62491</link>
      <description>&lt;P&gt;ok, thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/17874"&gt;@RussRoberts&lt;/a&gt;!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 14:13:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/related-data-arcade-expression-in-layer-style/m-p/1560720#M62491</guid>
      <dc:creator>HelenCooper</dc:creator>
      <dc:date>2024-11-20T14:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: related data Arcade expression in layer style</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/related-data-arcade-expression-in-layer-style/m-p/1561185#M62509</link>
      <description>&lt;P&gt;As Russ said this isn't a great idea for dynamic symbolization. There's an idea for it somewhere.&lt;/P&gt;&lt;P&gt;But if you're just after count, you may be able to utilize a Join and count statistic. See this post here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-questions/symbolize-by-related-table-in-arcgis-webmap/td-p/1070198" target="_blank"&gt;https://community.esri.com/t5/arcgis-online-questions/symbolize-by-related-table-in-arcgis-webmap/td-p/1070198&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There'll be some limitations listed below and you may have to remove the join to do things like add fields in future.&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/arcgis-online/analyze/join-features-mv.htm" target="_blank"&gt;https://doc.arcgis.com/en/arcgis-online/analyze/join-features-mv.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 11:34:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/related-data-arcade-expression-in-layer-style/m-p/1561185#M62509</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-11-21T11:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: related data Arcade expression in layer style</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/related-data-arcade-expression-in-layer-style/m-p/1561188#M62510</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/412943"&gt;@ChristopherCounsell&lt;/a&gt;&amp;nbsp;, unfortunately I'm not hosting either of these layers, so my ability to set a join up is limited.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 11:41:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/related-data-arcade-expression-in-layer-style/m-p/1561188#M62510</guid>
      <dc:creator>HelenCooper</dc:creator>
      <dc:date>2024-11-21T11:41:57Z</dc:date>
    </item>
  </channel>
</rss>

