Overlapping Features in Pop-Ups Quick Introduction to Using FeatureSets with Arcade

61988
163
12-10-2018 11:08 AM
KellyGerrow
Esri Frequent Contributor
35 163 62K

With the December update of ArcGIS Online, the ability to reference other layers using Arcade Expressions in Pop-Ups was introduced. This blog is going to outline a quick example about how to create a simple intersect expression and display the results in a Pop-Up.

In this example I have used 4 layers marked as authoritative in ArcGIS Online by  Miami-Dade County, Florida. I want to display the Elementary, Middle and High School names which intersect with building footprints in a single pop-up. I have three layers of School Attendance Boundaries which identifies a specific school boundary which overlaps with many building footprints. The building footprint layer contains geometry information but no information about the infrastructure or zones that intersect with the building.

This Web Map shows examples of the information available in these layers in 4 separate layers.

Unedited Pop-ups

Using the new Arcade FeatureSet functionality, I was able to include the Elementary, Middle and High School names in the building footprint pop up in this web map

feature set

Here are the steps to set up this simple intersecting Arcade Expressions to include in a pop-up.

  1. Add all the desired layers with information that you would like to see to a web map.

  2. Select the layer that should display the pop-up information (Building Footprint)

  3. Inspect the School Attendance Boundary layers to identify the fields that you would like to display in the Building Footprint layer Name)

  4. Select Configure Pop up and navigate to the Add Attribute Expressions

  5. Create the expression for each layer.

    1. Create a variable that returns the FeatureSet of intersecting feature attributes.

      var intersectLayer =Intersects(FeatureSetByName($map,"Elementary School Attendance Boundary"), $feature)

      Expression Values Explained:

      var intersectLayer – specifies the intersecting features variable name

      Intersects – specifies the geometry function one feature intersects the geometry of the other specified layer.

      FeatureSetByName  Creates a FeatureSet from a Feature Layer based on its name within a map or feature service

      $map,"Elementary School Attendance Boundary"– identifies that the feature set is a layer named Elementary School Attendance Boundary, within the web map.

      $featureis the feature that is being selected in the Building Footprint layer that provides the initial spatial information.

         b.   Loop through the feature set created and return a specific field from the feature set:

           

for (var f in intersectLayer){

    return f.NAME

}

6. Once all expressions are created, add them to the pop up configuration.

7. Disable the pop ups and potentially the visibility from the School Attendance Boundary Layers (Not required, but I think it cleans up the display,

8.Check out your pop up with information from intersecting layers.

There will be more documentation, blogs and examples coming out in the next week, but try out this quick sample with simple intersecting layers and let us know if you have questions.

Entire expression for a single high school name:

var intersectLayer =Intersects(FeatureSetByName($map,"Elementary School Attendance Boundary"), $feature)

for (var f in intersectLayer){
return f.NAME
}

163 Comments
MichaelMiller2
Occasional Contributor III

Thank You Xander Bakker!  I was afraid that was going to be the answer.

XanderBakker
Esri Esteemed Contributor

Hi Michael Miller ,

I do think it would be a great addition to Arcade to have a global variable that represents the point on the map where the user clicked. You are not the first to ask for this functionality. If you are willing to create an idea: https://community.esri.com/community/arcgis-ideas and post back the link of the idea, you will have my vote for sure. 

DerekNewland
New Contributor III

Okay, so I'm not much with scripting but I try what I can. My main issue right now is how do I get the globals from one layer to show up in another layer's configure pop-up menu? Or am I missing something? I'm only dealing with 2 hosted feature layers where I would like to show what field from the intersecting layer and 2 fields from the layer to be intersected. If I try to write the script in the intersecting layers pop-up configuration the fields aren't found. Any help or schooling on this would be much appreciated.

Thank you

Derek

XanderBakker
Esri Esteemed Contributor

Hi Derek Newland ,

Your intersecting features will not appear without writing some lines of Arcade to have access to intersecting features in another layer.

I have a post here that explains a little more what you can do, perhaps it helps: https://community.esri.com/docs/DOC-12773-using-featuresetby-functions-in-arcade-to-drill-down-to-ot...

DerekNewland
New Contributor III

Hmmmm, okay so I'm assuming there is more to getting this function to work than just the scripting that was presented.

but $datastore would allow for what I need then?

XanderBakker
Esri Esteemed Contributor

Your expression would probably be a little longer than the one presented here, but not too long depending what you want to do with the attributed of the intersecting features (how you want to present them).

  • the $datastore allows you to access the other (intersecting) layer using the exact name in the datastore (both should be in the same datastore)
  • if you use $map you will be able to access the other layer using the exact name it has in the map (both layers should be in the same map)
TimothyKing3
Occasional Contributor

Hi Xander,

I am trying to accomplish two tasks with Arcade within a pop-up. I want to use the Touches function to return the text Yes if the area touches another polygon and No if it does not.  I have been able to get the Boolean return of true or false but I am unsure how to turn that into text.

The second thing I would like to do is calculate the area of an overlap between two polygons.  I tried using Clip but kept getting an error.

Also when editing a popup in ArcGIS Pro do those changes get saved to the webmap?

Thanks.

LTK

XanderBakker
Esri Esteemed Contributor

Hi Timothy King , 

Can you explain a little more about your use case? You are trying to obtain the intersecting area and the result of the touching polygons in the pop-up of a web map? Are you editing the web map using ArcGIS Pro? Can you share the code that you have at this point?

TimothyKing3
Occasional Contributor

Sure thing Xander,

I have a site boundary poly that I want to get counts for a number of point and poly feature layers.  That is working fine except I may be able to combine some together but I am still new to Arcade.  I do a double Filter to get the data I want and then return the number and put it in the popup.

var BooneUnspecifiedFeaturePoly = Filter(Filter(FeatureSetById($map, /* Features (polygons) */ "NM_Sites_Reporting_2755"), "BLACKED OUT = 'Unspecified'"), "Source = 'Boone'")
var CountBooneUnspecifiedFeaturePoly = Count(Intersects(BooneUnspecifiedFeaturePoly, $feature))
return CountBooneUnspecifiedFeaturePoly

But I would really like to use the Clip or Intersection to get the acreage of the poly that falls within the corridor polygon.  

I also would love to be able to use a Geometry function to search a distance and locate the closest point, line or poly from a feature layer and return attributes from the layer so that I can add them to the popup.  I have been able to get SSURGO soils data and the USGS Topo quads to work (I only get one value returned and would like to learn how I could pull in additional info since a site may straddle two or more soil types or topo quads.  

Here is  a screengrab of the popup with the Soils and Quad info pulled from the feature layers.

Thanks for you help! It is much appreciated!

LTK

TimothyKing3
Occasional Contributor

Oh I am editing the formulas in the webmap on AGO.  When I opened up the pop-ups in ArcGIS Pro they did not look the same and I was worried that I might delete something by mistake. I would love to be able to edit them in Pro as it looks like you can actually name the expressions and tweak the look of the popup.  

DerekNewland
New Contributor III

So I got it working. It was just a matter of changing f.NAME to the proper field name. However, I have some areas where 1 parcel may have 2 zones and the expression is choosing 1 of the overlaps which isn't as big of a deal and is expected. Now I have found locations where the adjacent zone is what is being displayed. There is no overlap and and the topology tool is not showing any overlap of zoning polygons. No idea how to deal with this unless there is a way to force the pop up to choose the zone polygon with the highest percentage of overlap.

XanderBakker
Esri Esteemed Contributor

Hi Derek Newland ,

There are several ways you can resolve this. You could validate the intersecting overlap and choose the one with the largest area of overlap. This will require a different function. In case you have a result that does not overlap but touches the current polygon you could use the same intersecting area or apply a negative buffer to the feature before applying the intersects function as I describe here: https://community.esri.com/docs/DOC-12773-using-featuresetby-functions-in-arcade-to-drill-down-to-ot... (just scroll down to the bottom or search for buffer in the text to see the example).

XanderBakker
Esri Esteemed Contributor

Hi Timothy King ,

I guess I did not see your reply before. Sorry for that. A couple of pointers:

  • To use the intersecting area you should use the Intersection Arcade function. See: https://developers.arcgis.com/arcade/function-reference/geometry_functions/#intersection You can determine the area of the resulting features. Be aware that when using $feature the geometry of the feature will depend on the zoom scale.
  • There are differences between the pop-up configured in Pro and AGOL. For instance in Pro you can generate HTML, and in AGOL this part is currently stripped or simply interpreted as text. For now it is best to define the pop-up and expressions where you will be using it (in Pro or in AGOL). Hopefully, later on this will not be necessary.
KellyArmstrong
Occasional Contributor II

I have one layer that has overlapping features.  Is there a way to show both attributes on a popup without an arrow to view the other?  I know the examples above mention overlapping features from multiple layers, but I am only interested in just one layer.

XanderBakker
Esri Esteemed Contributor

Hi Kelly Armstrong ,

To some extent this is possible, but it is important to understand that you won't have access to actual point the user clicked. So, if you have a polygon A that intersects 2 polygons (B and C) from another layer and you click on a part of polygon A that overlaps polygon B, when you process the intersection you will obtain both B and C (not just B). Is that acceptable for you?

DerekNewland
New Contributor III

Hello Xander,

Thank you very much, I was able to get the buffer to work. What function would I use to validate the overlap? Or is that possible in Arcade at all?

XanderBakker
Esri Esteemed Contributor

Hi Derek Newland ,

The document I referred to in my previous reply also shows how to intersect polygons after applying the negative buffer. Maybe you can share the code that you have up to now. With that I can provide an example expression that will evaluate the area of overlap. In which case you wouldn't need the buffer.

XanderBakker
Esri Esteemed Contributor

Hi Derek Newland ,

Just to provide an example of what you can do, see the screenshot below. I have two layers; one with polygons A and B and the other with the smaller polygons C, D and E. The pop-up is configured for the layer with the smaller polygons and intersects the larger polygons to determine which has the largest overlap:

The code used in this example:

var area_small = Area($feature, 'ha');
var largepolygons = Intersects(FeatureSetByName($map,"LargeAreas"), $feature);
var area_max = 0;
var polyname_max = "";
var result = "";
var cnt = Count(largepolygons);
if (cnt > 0) {
    result = "There is overlap with " + cnt + " polygons:" +TextFormatting.NewLine;
    for (var largep in largepolygons) {
        var area_i = Area(Intersection($feature, largep), 'ha');
        var perc_i = Round(area_i/area_small * 100.0, 2);
        result += TextFormatting.NewLine + " - Overlap with " + largep.Name + " is " + Round(area_i, 2) + "ha.  ->  (" + perc_i + "%)";
        if (area_i > area_max) {
            area_max = area_i;
            polyname_max = largep.Name;
        }
    }
    result += TextFormatting.NewLine + TextFormatting.NewLine + "largest overlap is with polygon " + polyname_max;
} else {
    result = "There is no overlap with other polygons";
}
return result;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
JamesCrandall
MVP Frequent Contributor

This is exciting.  I'm doing this now but within a "heavy" GP service that has to query map service layers, create localized geometry, perform clip operation, etc... To be able to accomplish this in a popup is really powerful and look forward to implementing Arcade more and more into our products.


Thanks for the example!

PanGIS
by
Occasional Contributor III

Thank you for this great feature!

Xander Bakker

I have a problem though, I tried to get the popup info for features in two different layers overlapping a polygon.

this is my code.

It works well only if one layer only overlays:

// test intersect

var intersectLayer =Intersects(FeatureSetByName($map,"Layer1"), $feature)
var intersectLayer2 =Intersects(FeatureSetByName($map,"Layer2"), $feature)
for (var f in intersectLayer){
return  "Layer 1 info" + "\x0d\x0a" +"Name: " + f.Name + "\x0d\x0a" +"Type: " + f.Type
}
for (var f in intersectLayer2){
return  "Layer 2 info" + "\x0d\x0a" + "Name: " + f.Name 
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
‍‍‍‍‍‍‍‍‍‍

Results:

If the polygon intersects layer1 and layer2  only layer 1  is shown  (layer1 is the house icon, layer2 the dot)

If the polygon intersects layer2: it's ok

Here I have even more than one features in layer 2, but still only layer1 shown.

if I invert the two variables

// test intersect
var intersectLayer =Intersects(FeatureSetByName($map,"Layer1"), $feature)
var intersectLayer2 =Intersects(FeatureSetByName($map,"Layer2"), $feature)
for (var f in intersectLayer2){
return  "Layer 2 info" + "\x0d\x0a" + "Name: " + f.Name
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
for (var f in intersectLayer){
return  "Layer 1 info" + "\x0d\x0a" +"Name: " + f.Name + "\x0d\x0a" +"Type: " + f.Type
}

I get info for only one dot in layer2:

Thanks!
XanderBakker
Esri Esteemed Contributor

Hi Pan gis ,

This issue here is that you are returning data from each for loop. What you want to do is create a variable before the loops start and add values to that variable in each loop and return the result at the end of the expression.

Something like this:

var intersectLayer = Intersects(FeatureSetByName($map,"Layer1"), $feature);
var intersectLayer2 =Intersects(FeatureSetByName($map,"Layer2"), $feature);
var result = "";
for (var f in intersectLayer){
    result += "Layer 1 info" + "\x0d\x0a" +"Name: " + f.Name + "\x0d\x0a" +"Type: " + f.Type;
}
for (var f in intersectLayer2){
    result += "Layer 2 info" + "\x0d\x0a" + "Name: " + f.Name;
}
return result;

You can also replace the "\x0d\x0a" with TextFormatting.NewLine

PanGIS
by
Occasional Contributor III

Great Xander!

It works!

Thank you

XanderBakker
Esri Esteemed Contributor

Hi pan_gis ,

Glad to hear that it works!

GIS_Spellblade
Occasional Contributor

I have 2 questions about using geometry functions in Arcade:

  1. When will geometry functions be able to be used in symbolizing a web map?
  2. Is there a way to use geometry functions to run field calculations within Pro?

The general use case is that I have an end-user using a grid, and they would like to know when a certain thing has happened in a grid. The geometry function is perfect for the pop-up to count how many things are within that grid, but ideally, I would like the map to be a dynamic checkerboard to visually show progress. The second thing would be to use an arcade geometry calculation within Pro to run a calculate field command, for me, this seems like it could be a bit simpler than running a python script to run a series of tools to count. 

Generally, this is the pattern that I'm following for the expression:

var geom2 = FeatureSetByName($map,"MosquitoTraps")

return(Count(Intersects($feature, geom2)))

This works in the pop-up just fine, but in symbolizing or field calculating I get the Object not found $map error.

Any help would be appreciated!

XanderBakker
Esri Esteemed Contributor

Hi Jordan Carmona ,

For Field Calculations you will have to use the $datastore and not the $map to access the other layer. When you use $datastore, use the exact name of the featureclass in the datastore. That is what is causing the error message.

It is not possible to use the FeatureSetBy* functions for symbolizing your data. The reason is performance. When you use the FeatureSetBy* functions in a pop-up, you will have to execute it for a single feature. In case of symbology this might be thousands of features and each feature will access the other layer, intersect it and count  the features. This will have an huge impact on performance. That is why those functions have not been enabled (yet).

If you data is dynamic you should repeat the field calculation at a certain interval to have your grid polygons represent the changing number of points.

GIS_Spellblade
Occasional Contributor

Thanks for the quick response! I'm assuming that $datastore requires

actually having a datastore via Portal? Is there a way to access this

functionality on a single machine deployment of Pro?

XanderBakker
Esri Esteemed Contributor

Hi Jordan Carmona ,

As far as I know you should be able to use different featureclasses that are stored in the same File Geodatabase for instance. That will be the same $datastore.

KellyDoss1
New Contributor II

Hello all,

I'm pretty new to Arcade and I think this is the right blog for what I want to do, but I'm having problems.

I have a hosted feature layer with several related tables, some of which are 1:M.  In the CIP_Test pop-up, for the 1:M related tables, I only need to show the data from the rows with the latest "Date Modified".

I've attached a screenshot of the related table.  Where there are duplicate AcctNo, I only want to show the ProjectPhase (and maybe other fields) for the record that was last modified.

Any suggestions on how to do this are much appreciated!  I have gotten nothing but errors in everything I've tried from any forum posts I've found....

XanderBakker
Esri Esteemed Contributor

Hi Kelly.Doss_DurhamNC ,

You could probably try something like shown below. Keep in mind that you need to change some field names to match your data. The idea is to get the ID from the current feature and create a filter to get the related project phases. This is sorted descending on the date and you get the first element from the result, which should be the most recent change in project phase.

var yourid = $feature.YourIdField; // change the name of the field
var tblphases = FeatureSetByName($map, "CIP Test - Project Phase");
var sql = "YourIdField = '" + yourid + "'"; // if field is text
var relphases = Filter(tblphases, sql);
var cnt = Count(relphases);
Console(cnt);

var result = "";
if (cnt > 0) {
    result = "Project phase:" + TextFormatting.NewLine;
    var currentphase = First(OrderBy(relphases, 'DateModified DESC'));
    result += "Date : " + currentphase.DateModified + TextFormatting.NewLine;
    result += "Phase: " + currentphase.ProjectPhase;
    return result;
} else {
    result = "There are no project phases defined";
}

return result;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

If the data is related using a relationshipclass, it can be done in a more easy way. 

TL2
by
Occasional Contributor III

Xander Bakker

Using this we can now access related table data but we still can't symbolize or label using the same logic?

Is this still a limitation? Seems like we still can't.

XanderBakker
Esri Esteemed Contributor

Hi T L ,

I'm afraid you are right, this functionality is still limited to pop-ups and field calculations. For now your best option (although far from optimal) is to use a field calculation to create a physical result and use that field for symbology and labeling. 

AllisonGoldberg1
New Contributor II

I am trying to formulate an arcade expression for a bunch of polygon flood related feature classes. I am trying to intersect each of those features with our parcel layer. The ultimate goal is to dynamically add the name of those flood zones to a custom attribute popup expression within our parcel data. The problem I am running into is that some of the parcels have split flood zones. I want to 1. show all the possible options for each parcel's flood zone AND 2. Have another custom attribute expression that returns the value for the highest flood risk zone. The featureset works fine for a single option but when it has split and I am doing it based on attributes (and not largest area for buffering or based on percentages) I cannot get the syntax formatted properly. The idea is for a customer to be able to search for their address and know all the information about the flood hazards at that location. Any help would be greatly appreciated. Thanks. 

XanderBakker
Esri Esteemed Contributor

Hi agoldberg_Pinellas_eGIS ,

Can you start a new question for this specific request? This thread is getting very long and it will be difficult for other users to find relevant answers. Can you also share the expression that you have up to now and show the current output and explain a little more as to what you would like to obtain?

TrishaSchlake
New Contributor III

Hi Xander Bakker

I have a parcel feature layer and a soils feature layer in my webmap. I'm trying to apply the arcade to my parcels layer so that when a parcel is clicked it will give me the corresponding soils to that parcel. The issue is that there could be more than one soil per parcel. The expression I currently have applied to my parcel feature class is this: 

 var intersectLayer = Intersects(FeatureSetByName($map,"STATSGO2Soils"), $feature)
for(var f in intersectLayer){
return f.muname
}

But it will only return one of my soils into the parcel and will not bring in multiple soils names. Is there a way to do what I'm hoping to do? 

I will keep researching, maybe I can figure it out yet.  

XanderBakker
Esri Esteemed Contributor

Hi Trisha Schlake ,

Could you branch this question to a new question? I will be happy to help you create the expression, but this thread is growing very large and it will be difficult for others to find relevant answers. Thanks!

VHolubec
Esri Regular Contributor

Hi Kelly Gerrow‌, thank you for great article!

Just one question - It seems $map is not supported in ArcGIS PRO 2.5? Is it by design? 

It would be great to add it to PRO too. As Xander Bakker noted $datastore works fine, with the limit, that both layers must be in the same FGDB.

Have a great day!

Regards,

Vladimir

KyleWikstrom
Occasional Contributor II

Hi Kelly Gerrow‌,

Have you encountered expressions like this returning 'Show' hyperlink in the web map table, or '[object promise]' in Web AppBuilder's Attribute Table for features that have this type of Arcade expression that pulls attribute values from an intersecting layer?

Kyle

XanderBakker
Esri Esteemed Contributor

Hi Kyle Wikstrom ,

What kind of information (or type of data) does the expression return? Does this only happen in the attribute table in WAB or also in the web map?

KyleWikstrom
Occasional Contributor II

Hey Xander Bakker‌,

The Arcade expression is returning a string. The web map attribute table shows the expression attribute columns and the values say 'Show' and appear like a hyperlink (blue and clickable). When 'Show' is clicked, the 'Show' value disappears and the cell is empty. For a few minutes yesterday, clicking 'Show' would display the correct result from the Arcade expression.

In Web AppBuilder, the Attribute Table widget displays the attribute columns for the Arcade expressions, but the value for all of them is text that says '[object Promise]'. This can be seen in the web application (ArcGIS Web Application ) by opening the Attribute Table. Taxpayer Name, Taxpayer Address Line 1, Taxpayer Address Line 2, Parcel ID, and Homestead Description are all Arcade expressions that return '[object Promise]' in the cell. The correct value displays in the map popup.

The Arcade expression for Taxpayer Name is as follows. Note that this is used for each expression and the only difference in each of them is the name of the attribute returned from the intersecting layer.

var intersectLayer = Intersects(FeatureSetByName($map,"Tax Parcels"), $feature);

for (var i in intersectLayer) {
return i.TAXPAYER_NAME
}

XanderBakker
Esri Esteemed Contributor

Hi Kyle Wikstrom ,

There is not much wrong with the expression. The only comment I have is that when you use return inside a loop, you will return at the first record. To "optimize" processing you could only request the field you need, and not have it return the geometry and nest it in one single line, to reduce the number of requests (although I have heard that this might not be true):

return First(Intersects(FeatureSetByName($map,"Tax Parcels", ["TAXPAYER_NAME"], False), $feature)).TAXPAYER_NAME;

If you have seen a correct result for some time and most of the time it does not provide any result, you may want to check your source data. Maybe the access is intermittent. Are you using AGOL, Enterprise, Pro, local FGDB, EGDB, hosted feature layer as source?

KyleWikstrom
Occasional Contributor II

Hey again Xander Bakker

This expression produces the correct values in the popup, but the web map table displays 'Data Error'.

I removed a Visible Scale setting on the layer so that the layer is visible when the map is launched. When I reloaded the map, the attribute table would display a hyperlink saying 'Show', and when clicked it would display the correct result. When opening the Web AppBuilder Attribute Table, the attribute columns still display '[object Promise]' when using the new Arcade expression and after removing the Scale Visibility setting.

The web map and application are hosted in AGO, the data is in a local enterprise geodatabase and being served through ArcGIS Server as a Feature Layer. The map services were published using ArcMap.

XanderBakker
Esri Esteemed Contributor

Hi Kyle Wikstrom , 

I forgot to ask which version is your Server implementation, but maybe that is not what is causing the problem. The pop-up shows the data correctly, since it is a single request to the server (it just needs to do one intersection). When you open the attribute table it will show arcade expression results. However, since the FeatureSetByName function is only available in several profiles (pop-up, calculate attribute, etc) and not in the ones that could result in multiple requests and performance hits (labels, symbology, etc) I guess you only see the link that allows you to execute a single expression at the time. This will also affect behavior that is derived from this; like sorting the table on a "virtual" field defined by an Arcade expression. Maybe this is why the execution of the expression from the attribute table is not working properly. Although I guess this should work and if it doesn't might merit a call to support.

In case your data is not dynamic (but I assume it is) you could do a field calculation and create the static result using the same expression or define an attribute rule that is triggered when data is updated or created (but this does not trigger updates in the parcel layer).  

RVx_GaslineGiS
New Contributor III

Is it possible to do this with self-intersecting lines? For example, I have a layer with many lines close together. I'd like a click to only show one pop-up instead of 2-3 and just aggregate the data from within that single layer.

XanderBakker
Esri Esteemed Contributor

Hi Robert Domiano ,

Arcade will not help you to avoid retrieving the pop-up for all the features within the clic tolerance. However, you can use Arcade to resume the feature in a single pop-up. Please note, that Arcade does not have access to the location where you clicked and will use the entire feature geometry. When you search for features within a certain distance, it will return probably more features than what the user expects. Additionally, doing this will affect performance and should be evaluated to see if the result is appropriate, but I assume it will not.

SueJohnston
New Contributor III

Xander BakkerKelly Gerrow

Great information here guys!  Am I missing how I can use one expression to loop thru multiple layers, or is that not a good idea?  I would like to find see if a parcel intersects with 9 different layers, I've started to do by individual expression, but I'm wondering if there's a better way?

Thanks!

Sue

XanderBakker
Esri Esteemed Contributor

Hi Suej , 

You can do this, but doing Intersects with 9 different layers will have an impact on performance. If the structure of the layers is the same, you could create a function inside Arcade that will gather the information pero layer and use a loop to execute that function for each layer. I will need some more details to help you further...

SueJohnston
New Contributor III

Hi Xander Bakker, Thanks for the quick response!  That would be great. What details do you need?

All but one layer are polygons, one is a point.

XanderBakker
Esri Esteemed Contributor

Hi Sue Johnston ,

Sorry for for the delay in my response. It has been a hectic couple of days. The easiest way would be to have access to the data (for instance invite my AGOL user "xbakker.spx" to a group where you share the content) and explain a bit more what data you would like to retrieve from each layer and how you want to present it. 

SueJohnston
New Contributor III

Thanks Xander Bakker‌,

I've invited you to a group.  Basically I want the user to click on the parcel of a particular address and just have a popup to show whether or not that address is in an specific area (ie.  Development Charges, Conservation Flood Area, a Heritage Property, etc)  and I only really need a Yes or No response, maybe in the form of a line of instruction...no action required or contact the office type thing.

Let me know when you have a chance to look, and I can provide you with more detail.
Thanks so much for taking the time

Sue

XanderBakker
Esri Esteemed Contributor

Hi Sue Johnston ,

I just had a look at the map "Permit Tracker Map-PopUp" you shared, and I notice that the layer "PopUpDetails" already has a couple o expression configured that do part of what you want.

You also have a grouplayer "PermitCheckListMap" in your map, but I have the impression that these layers cannot be accessed by the Arcade expression. So if your logic is based on retrieving information from the "PermitCheckListMap" group layer, this might be difficult. Not sure if this is due to the fact that it is a map service of ArcGIS Server 10.5.1. 

About the Author
I love interactive maps and apps on the internet! The maps and apps that customers create and share on the web, make my job awesome. I'm a Product Manager with the ArcGIS Online team in Redlands, California. I am a proud graduate from Carleton University and the COGS in Canada, with research focus' in Health Geography. Originally from Bedford, NS, Canada but have spent a lot of time in Haliburton and Ottawa, Ontario. I have a passion for the outdoors and dogs.