HI I want to write an Arcade expression in a pop up.
I have two polygon layers in my web map
Suburb polygon and Flood polygon
I want to appear the name of the suburb in the flood event pop up when click on the suburb layer
My expression is
var SI = FeatureSetByName($map,"Suburb")
var int = First(Intersects($feature, SI))
The expression returns a suburb name but it returns the same name all the time for example "suburb 1". If I click in another suburb it still return the name "suburb 1"
When you click on the flood area you want to see the suburb at the location where you clicked. The problem is that when you start with the flood area polygon it will use the entire polygon to see what suburbs it intersects with and when your flood area polygon is large it will intersect with a large number of suburbs. At this moment it is not possible in the Arcade expression to have access to the location where the user clicked and therewith being able to return a single suburb at the location. You will have in the pop-up a button to go through all the features at the location where the user clicked and have access to the suburb, but not as you want in the pop-up of the flood area:
You could also go a little further and present information of multiple suburbs and the % of the area that the flood area covers the suburb. There are many possibilities.
I have created an idea to provide access to the location clicked, but it is not implemented yet. Hopefully, this will happen soon.