Select to view content in your preferred language

Pull multiple attributes from multiple overlapping layers in single popup

2858
34
Jump to solution
08-23-2023 08:19 AM
Ed_
by MVP Regular Contributor
MVP Regular Contributor

I have three layers, two of them are polygons (parcels and buildings) and one of them is a point. I would like the parcel's popup to return multiple attributes/columns from the building layer as well as the point layer.

 

Based on the code below, I am able to show a single corresponding attribute from the building layer when a parcel is clicked.

But now I want to return more attributes from the building layer as well. 

How can I do this?

Like let's say I also want return values from the columns `LenFt` and `ID` then how can I do that?

Side question: Also is there a way to add contextual text before the attribute value in the Arcade code?

Like let's say I want to add bold `Area:`, `Length:` and `ID:` before each of the returned attribute value.

Attributes of interest from the building layer:

SaadullahBaloch_0-1692803933589.png

 

Code:

 

// Create a variable that the FeatureSet of intersecting feature attributes  
var building = FeatureSetByName($map, "BuildingFootprints_Clip")

var intersectLayer = Intersects(building, $feature)  

for (var f in intersectLayer){ 
	
	var popup = f.AREAFT
	
	}  
 
 return popup

 

 

Question | Analyze | Visualize
34 Replies
Ed_
by MVP Regular Contributor
MVP Regular Contributor

Good morning, Ken, hope all is well and thank you for the quick response. So what I did in line 40 by using $feature was just to try and see if I can get the `FOLIO` attribute that way (which I am thinking is not the right way). However, all I want is the attribute value just like in the for loops of the intersected layers. So that's why in line 41 I am using the variable `parcel` to pull the attribute value of the clicked parcel.

So I don't know really know what approach should I take. What should I do?

Question | Analyze | Visualize
0 Kudos
KenBuja
MVP Esteemed Contributor

If I understand what you're trying to do, you still need to get the intersection of the feature and the parcel layer. Since that's only a point, it should return a single parcel.

var parcels = FeatureSetByName($map, "Parcels_with_FloodFacto_Clip")
var parcel = First(Intersects(parcels, $feature));

popup += `<b>Folio:</b>${$parcel.FOLIO}<br><br>
<b>FSID:</b>${$parcel.fsid} <br><br>`

 

Ed_
by MVP Regular Contributor
MVP Regular Contributor

Hi Ken so the feature is actually the parcel so, that's why I think it does not need the intersect right? 

The parcel can be seen in the yellow boundary, the other two are the intersected layers i.e., the buildings and points.

SaadullahBaloch_0-1693418422915.png

 

And so the popup appears when the user clicks on a parcel as shown below:

SaadullahBaloch_1-1693418497656.png

 

Question | Analyze | Visualize
0 Kudos
KenBuja
MVP Esteemed Contributor

Is this popup for the parcel layer? If so, then you'd just need this

popup += `<b>Folio:</b>${$feature.FOLIO}<br><br>
<b>FSID:</b>${$feature.fsid} <br><br>`

 

Ed_
by MVP Regular Contributor
MVP Regular Contributor

Happy Monday @KenBuja hope all is well, I have a follow up question so, let's say my popup is getting too big (too much scrolling) then, is it possible to add page breaks (add pages) to the popup?

Maybe something similar to this?

SaadullahBaloch_0-1695070719642.png

 

Question | Analyze | Visualize
0 Kudos