<?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 Pop-up expression Help in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-up-expression-help/m-p/1191226#M46901</link>
    <description>&lt;P&gt;Hello, I'm tyring to pull through information on habitats from habitats layer within the Site Boundary feature (as $feature) in this pop-up expression. So far it has been working fine when hard coding the Baseline_habitat_Type to match the expected values in the 'habitats layer' features, but i am now developing it to read the unique 'baseline_habitat_type's from the features that intersect and run a for loop off this, any help would be greatly appriciated as to why this is producing the result:&lt;/P&gt;&lt;P&gt;Result Value&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Result&lt;/TD&gt;&lt;TD&gt;[&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A target="_blank"&gt;0 - 0 ha&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A target="_blank"&gt;1 - 0 ha&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Array&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var habs = Intersects(
    FeatureSetByName(
        $map,"Habitats Layer",["Site_Code","Baseline_Broad_Habitat","Baseline_Habitat_Type","Baseline_Condition","Shape__Area"]),
        $feature)

//variables
var intcount = count(habs)
var expr = ''
var areaString = ''
var outArr = []
var outArr_index = 0

//generate unique habitat types array
var ListHabs = []
var ListHabs_Index = 0

for (var hab in habs){
    ListHabs[ListHabs_Index] = hab.Baseline_Habitat_Type
            ++ListHabs_Index
}

var UniqListHabs = distinct(ListHabs)

if (intcount &amp;gt; 0){
    for (var UniqListHab in UniqListHabs){
        var UniqListHabArea = 0
        for (var hab in habs){
            if (hab.Baseline_Habitat_Type == UniqListHab){
                UniqListHabArea += hab.Shape_Area
            }
        }
        outarr[outArr_index] = 
        UniqListHab + " - " + round(UniqListHabArea*0.0001, 2) + ' ha' + TextFormatting.NewLine
        ++outArr_index
    }
    expr = Sort(outarr)
}

else{
    expr = 'No Baseline currently mapped or uploaded for ' + $feature["Site_Code"]
}
return expr&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jul 2022 13:35:53 GMT</pubDate>
    <dc:creator>George_Offer</dc:creator>
    <dc:date>2022-07-11T13:35:53Z</dc:date>
    <item>
      <title>Arcade Pop-up expression Help</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-up-expression-help/m-p/1191226#M46901</link>
      <description>&lt;P&gt;Hello, I'm tyring to pull through information on habitats from habitats layer within the Site Boundary feature (as $feature) in this pop-up expression. So far it has been working fine when hard coding the Baseline_habitat_Type to match the expected values in the 'habitats layer' features, but i am now developing it to read the unique 'baseline_habitat_type's from the features that intersect and run a for loop off this, any help would be greatly appriciated as to why this is producing the result:&lt;/P&gt;&lt;P&gt;Result Value&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Result&lt;/TD&gt;&lt;TD&gt;[&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A target="_blank"&gt;0 - 0 ha&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A target="_blank"&gt;1 - 0 ha&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Array&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var habs = Intersects(
    FeatureSetByName(
        $map,"Habitats Layer",["Site_Code","Baseline_Broad_Habitat","Baseline_Habitat_Type","Baseline_Condition","Shape__Area"]),
        $feature)

//variables
var intcount = count(habs)
var expr = ''
var areaString = ''
var outArr = []
var outArr_index = 0

//generate unique habitat types array
var ListHabs = []
var ListHabs_Index = 0

for (var hab in habs){
    ListHabs[ListHabs_Index] = hab.Baseline_Habitat_Type
            ++ListHabs_Index
}

var UniqListHabs = distinct(ListHabs)

if (intcount &amp;gt; 0){
    for (var UniqListHab in UniqListHabs){
        var UniqListHabArea = 0
        for (var hab in habs){
            if (hab.Baseline_Habitat_Type == UniqListHab){
                UniqListHabArea += hab.Shape_Area
            }
        }
        outarr[outArr_index] = 
        UniqListHab + " - " + round(UniqListHabArea*0.0001, 2) + ' ha' + TextFormatting.NewLine
        ++outArr_index
    }
    expr = Sort(outarr)
}

else{
    expr = 'No Baseline currently mapped or uploaded for ' + $feature["Site_Code"]
}
return expr&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 13:35:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-up-expression-help/m-p/1191226#M46901</guid>
      <dc:creator>George_Offer</dc:creator>
      <dc:date>2022-07-11T13:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Pop-up expression Help</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-up-expression-help/m-p/1191263#M46906</link>
      <description>&lt;P&gt;Do you want the output to be a string of the values in the expr array? If so, then just use the &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#concatenate" target="_self"&gt;Concatenate&lt;/A&gt; function&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;expr = Concatenate(Sort(outarr), ", ");&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Jul 2022 15:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-up-expression-help/m-p/1191263#M46906</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-07-11T15:28:13Z</dc:date>
    </item>
  </channel>
</rss>

