<?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 Expression Popup question in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133835#M43763</link>
    <description>&lt;P&gt;Assuming you want to get the land use by intersection with the parcel:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// load the land use layer
var fs_land_use = FeatureSetByName($map, "LandUse", ["*"], true)
// intersect the parcel feature with the land use layer
var fs_land_use_intersect = Intersects($feature, fs_land_use)
// get the first intersecting land use feature
var land_use_feature = First(fs_land_use_intersect)

// no land use feature? -&amp;gt; return null
if(land_use_feature == null) { return null }
// else return the land use field
return land_use_feature.LandUseField&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 14 Jan 2022 13:52:25 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2022-01-14T13:52:25Z</dc:date>
    <item>
      <title>Arcade Expression Popup question</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133819#M43762</link>
      <description>&lt;P&gt;I would like to use an arcade expression for a popup window and use 2 different layers.&amp;nbsp; The main layer I'm using is tax parcel layer where I'll show:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#8b0000"&gt;Parcel #:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt; {PARCELID}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#8b0000"&gt;Owner:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt; {OWNERNME1}&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT color="#8b0000"&gt;Address:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#8b0000"&gt; &lt;SPAN&gt;{SITEADDRESS}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have those 3 fields with no issue for the popup.&amp;nbsp; Issue I have is trying to add a field from a CAUV layer that gives the land-use name using arcade expression.&amp;nbsp; What would be the expression I would use to add the CAUV land-use name/field from a map layer to my tax parcel pop-up?&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the result I would like to have:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#8b0000"&gt;Parcel #:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt; {PARCELID}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#8b0000"&gt;Owner:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt; {OWNERNME1}&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT color="#8b0000"&gt;Address:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#8b0000"&gt; &lt;SPAN&gt;{SITEADDRESS}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LandUse:(this coming from a different layer within the map)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated!&amp;nbsp; Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 13:22:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133819#M43762</guid>
      <dc:creator>DavidAdelsberg</dc:creator>
      <dc:date>2022-01-14T13:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression Popup question</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133835#M43763</link>
      <description>&lt;P&gt;Assuming you want to get the land use by intersection with the parcel:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// load the land use layer
var fs_land_use = FeatureSetByName($map, "LandUse", ["*"], true)
// intersect the parcel feature with the land use layer
var fs_land_use_intersect = Intersects($feature, fs_land_use)
// get the first intersecting land use feature
var land_use_feature = First(fs_land_use_intersect)

// no land use feature? -&amp;gt; return null
if(land_use_feature == null) { return null }
// else return the land use field
return land_use_feature.LandUseField&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 Jan 2022 13:52:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133835#M43763</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-01-14T13:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression Popup question</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133853#M43764</link>
      <description>&lt;P&gt;We do this for some of our parcel maps, and we use a similar process to what &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp; describes. I'd like to add a couple of points to the topic:&lt;/P&gt;&lt;P&gt;If the landuse and parcel layers do not align perfectly, you will have situations in which:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Multiple landuses exist for a parcel&lt;/LI&gt;&lt;LI&gt;A tiny sliver of adjacent landuse is included in the intersection, and mistakenly returned by the &lt;STRONG&gt;First&lt;/STRONG&gt; function&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If landuse and parcels overlay 1:1, that is, each parcel has 1 and only 1 landuse value, then consider modifying the parcel geometry prior to intersecting. You can:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Buffer the feature by a negative distance to back away from the parcel boundaries a bit.&lt;BR /&gt;Caveat: If the negative distance is too large, though, you will collapse to a null geometry and the intersection will return nothing.&lt;/LI&gt;&lt;LI&gt;Intersect based on the centroid of the feature.&lt;BR /&gt;Caveat: If the parcel has an irregular shape, the centroid may not fall within the feature itself, and your intersection will not be correct.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Of course, we can combine both approaches into one. A centroid-based intersection is simpler to perform, so we can default to that, resorting to the negative buffer if the input parcel shape is irregular.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Landuse
var lu = FeatureSetByName($map, "LandUse", ["landuse_type"])

// Feature centroid
var c = Centroid($feature)

// Check if feature does not contain its own centroid
var irreg = !Contains($feature, c)

// If irregular shape, use negative buffer method
// Otherwise use centroid
if(irreg){
    var shp = Buffer($feature, -10)
    var xs = Intersects(shp, lu)
} else {
    var xs = Intersects(c, lu)
}

// Check if intersecting features found, return first landuse value
if(Count(xs) &amp;gt; 0){
    return First(xs)['landuse_type']
} else {
    return 'No landuse features found'
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mind that this expression is only returning a single value. If you want a delimited string of multiple intersected values, let me know, as I have an expression for that as well.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 14:29:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133853#M43764</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-01-14T14:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression Popup question</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133855#M43765</link>
      <description>&lt;P&gt;Johannes,&lt;/P&gt;&lt;P&gt;I appreciate your time, but that didn't work.&amp;nbsp; I added that expression to my tax parcel configurable popup.&amp;nbsp; Attached is a pdf of 4 pages showing what I did and the layer I'm wanting to use to add to the popup window for my tax parcel. Maybe I did it wrong? &amp;nbsp; Not sure if showing this helps?&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 14:31:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133855#M43765</guid>
      <dc:creator>DavidAdelsberg</dc:creator>
      <dc:date>2022-01-14T14:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression Popup question</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133862#M43767</link>
      <description>&lt;P&gt;I didn't know your data structure, so I had to guess at the layer and field names. You should replace them with your real names.&lt;/P&gt;&lt;P&gt;Line 2: click on FeatureSetByName and replace my function with what you get&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1642171139672.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31526iBC51DADBE0065968/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1642171139672.png" alt="JohannesLindner_0-1642171139672.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Line 11: replace &lt;STRONG&gt;LandUseField&lt;/STRONG&gt; with &lt;STRONG&gt;Land_Use&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 14:40:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133862#M43767</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-01-14T14:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression Popup question</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133878#M43768</link>
      <description>&lt;P&gt;Josh,&lt;/P&gt;&lt;P&gt;Yes, could you give me a delimited string of multiple intersected values.&amp;nbsp; As I click on the parcel, there are 3 different land_use polygons within the 1 parcel and&amp;nbsp; only 1 result of the land_use shows. I take what you're saying would show all 3 land_use results in the popup?&lt;/P&gt;&lt;P&gt;Also, What you and Johannes gave me worked, but it's only showing the letter code of the land_use.&amp;nbsp; Why is it not showing the entire word?&amp;nbsp; I've attached 2 pictures, 1 showing what adding both of your expressions resulted in and the 2nd just showing the CAUV popup on it's own and what I want it to show--meaning full name of the landuse.&amp;nbsp; I appreciate your guys help.&amp;nbsp; This has been driving me nuts, as I'm not an arcade expression expert.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 15:00:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133878#M43768</guid>
      <dc:creator>DavidAdelsberg</dc:creator>
      <dc:date>2022-01-14T15:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression Popup question</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133893#M43770</link>
      <description>&lt;P&gt;I'm assuming your landuse uses coded domains, then? That's an easy fix. To list all three results is actually simpler than the whole centroid thing, too. You may still want to use a negative buffer, just in case of slivers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Landuse
var lu = FeatureSetByName($map, "LandUse", ["landuse_type"])

// Slightly shring feature
var shp = Buffer($feature, -1)

// Get intersecting features
var xs = Intersects(lu, shp)

// Output string
var out_str = ''

// Populate string with intersected landuse features
for (var x in xs){
    var lu_name = DomainName(x, 'landuse_type')
    out_str += `${lu_name}, ` // you could use anything you want for a delimiter here. |, /n, whatever you like
}

// Trim off last two characters. In my example, you'll end up with a ", " at the end
out_str = Left(out_str, Count(out_str) - 2)

return out_str&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 15:32:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133893#M43770</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-01-14T15:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression Popup question</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133909#M43771</link>
      <description>&lt;P&gt;Josh,&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp; This worked.&amp;nbsp; After seeing it though, I'll have to decide whether I'll use it cause it is picking up some of the other adjacent parcels land_use, probably do to the buffering and as you said earlier, the 2 different layers not aligning perfectly.&amp;nbsp; I'll maybe tweak some of the numbers in your expression to see how the results go.&lt;/P&gt;&lt;P&gt;Overall, I appreciate your time and help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 16:12:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133909#M43771</guid>
      <dc:creator>DavidAdelsberg</dc:creator>
      <dc:date>2022-01-14T16:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression Popup question</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133913#M43772</link>
      <description>&lt;P&gt;Happy to help! I used a negative buffer of -1 as an example, but in some of my maps I make that value as large as I can without collapsing any of my parcels, which is usually in the teens (of feet) somewhere.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 16:15:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-popup-question/m-p/1133913#M43772</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-01-14T16:15:05Z</dc:date>
    </item>
  </channel>
</rss>

