<?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: arcade script for popup in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-script-for-popup/m-p/1275261#M51270</link>
    <description>&lt;P&gt;This is certainly possible. Including spatial operations in a popup expression can cause your expression to take a bit longer to evaluate, but it's not too hard to put together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// create the 10km buffer
var buff = Buffer($feature, 10, 'kilometers')

// get intersecting schools
var xs_schools = Intersects(buff, FeatureSetByName($map, 'school_layer_name'))

// loop through the returned schools and populate an array
var school_list = []

for (var s in xs_schools) {
    // get distance
    var dist = Distance(s, $feature, 'kilometers')

    // push a formatted string to the school_list array
    Push(school_list, `${s['school_name_field']}: ${Text(dist, '#,###.0')} km away`)

// return a newline-delimited string from your array
return Concatenate(school_list, '\n')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Apr 2023 14:02:34 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2023-04-04T14:02:34Z</dc:date>
    <item>
      <title>arcade script for popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-script-for-popup/m-p/1275142#M51262</link>
      <description>&lt;P&gt;Hi! I would like a Arcade script for a popup that&amp;nbsp; shows me all the features within a buffer from one layer with their distances to the selected feature in an other layer.&lt;/P&gt;&lt;P&gt;for example: I selected an adress. The popup has to show all the schools by name within a distance of 10km, followed by their distance to the selected adress.&lt;/P&gt;&lt;P&gt;Can anyone help me?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 09:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-script-for-popup/m-p/1275142#M51262</guid>
      <dc:creator>IngridAnneessens</dc:creator>
      <dc:date>2023-04-04T09:47:50Z</dc:date>
    </item>
    <item>
      <title>Arcade script for popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-script-for-popup/m-p/1275141#M51354</link>
      <description>&lt;P&gt;Hi! I would like a Arcade script for a popup that&amp;nbsp; shows me all the features within a buffer from one layer with their distances to the selected feature in an other layer.&lt;/P&gt;&lt;P&gt;for example: I selected an adress. The popup has to show all the schools by name within a distance of 10km, followed by their distance to the selected adress.&lt;/P&gt;&lt;P&gt;Can anyone help me?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 09:41:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-script-for-popup/m-p/1275141#M51354</guid>
      <dc:creator>IngridAnneessens</dc:creator>
      <dc:date>2023-04-04T09:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: arcade script for popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-script-for-popup/m-p/1275261#M51270</link>
      <description>&lt;P&gt;This is certainly possible. Including spatial operations in a popup expression can cause your expression to take a bit longer to evaluate, but it's not too hard to put together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// create the 10km buffer
var buff = Buffer($feature, 10, 'kilometers')

// get intersecting schools
var xs_schools = Intersects(buff, FeatureSetByName($map, 'school_layer_name'))

// loop through the returned schools and populate an array
var school_list = []

for (var s in xs_schools) {
    // get distance
    var dist = Distance(s, $feature, 'kilometers')

    // push a formatted string to the school_list array
    Push(school_list, `${s['school_name_field']}: ${Text(dist, '#,###.0')} km away`)

// return a newline-delimited string from your array
return Concatenate(school_list, '\n')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 14:02:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-script-for-popup/m-p/1275261#M51270</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-04-04T14:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: arcade script for popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-script-for-popup/m-p/1275667#M51294</link>
      <description>&lt;P&gt;It Works! Thx&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 09:33:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-script-for-popup/m-p/1275667#M51294</guid>
      <dc:creator>IngridAnneessens</dc:creator>
      <dc:date>2023-04-05T09:33:21Z</dc:date>
    </item>
  </channel>
</rss>

