Select to view content in your preferred language

When will Arcade get more useful, esp with FeatureSet?

1629
16
10-19-2022 07:18 AM
DougBrowning
MVP Esteemed Contributor

Still wish there was a dedicated Arcade board.  It is not just AGOL anymore.  Anyway.

I have been using Arcade a ton.  Lots of useful stuff.  Most of my use cases use the FeatureSet functions.  Two biggest uses are grabbing info or a summary between parents and children in relationship classes and aggerating stats of Points in Polygons.  These work great and I can do some cool stuff.

Unfortunately only being able to use FeatureSet in a popup is really limiting what I can do for the user.  While popups are great the times a user will be clicking on each say polygon one by one is pretty slim. 

The problem is you cannot really do anything with the expression except look at it.

Lets say I have a calculation that does an avg of Bare Ground across all points in a polygon.  I want symbolize the polygons say red to green based on the Avg - nope can't.  Ok how about filter the map to show only Avgs under 40% - nope can't.  Ok I will open the attribute table and browse or sort - nope can't do that either.  Ok how about a label that shows good/bad - nope can't do that.  User finally says forget it I will export the data - nope Arcade goes away!

So users come back to me and say this is pretty and all but I cant actually do anything with it.

How are people dealing with this?  Again I love Arcade and its powerful but I am having a hard time finding good workflows to actually do anything with them.

I understand that FeatureSet can get slow and that will cause many of these to be painful.  I have suggested things like adding a where clause to the FeatureSet calls that would speed them up.  I have created a Arc Idea to calc the Arcade values on export.  Labels I think would be ok.  Filter I really thought would work but no FeatureSet is blocked.

Will any of these be opened up to FeatureSet at some point?  Any suggestions or tricks people have used?

Thank for any insight

16 Replies
jcarlson
MVP Esteemed Contributor

Belay that. Link remains, somehow. I tried getting the distinct and subsequently filtering, and the request to the server included the grouping and the filtering in the same request. Very curious...

- Josh Carlson
Kendall County GIS
DougBrowning
MVP Esteemed Contributor

We have the dashboard now with a data expression as you posted.  It turns rows red if a matching error report is found in the Error form layer.  And now with the Geometry(f) part right it will even change on zoom which is sweet.  thanks on that.

DougBrowning_2-1666277185395.png

 

Do you know how to get it to use the same symbology as the map in the list?  It works when its a layer but when it goes to data expression it changes all the symbols to the same symbol.  I think it may be the no value symbol from the map.  

DougBrowning_0-1666277047881.png

In the properties all I see is symbol on/off.

DougBrowning_1-1666277087813.png

Is there a way to say hey use the symbology from over on the map?  It is that or we have to recreate it in Ops using a big if statement I guess.

thanks

 

0 Kudos
jcarlson
MVP Esteemed Contributor

Yeah, I don't know if the FeatureSet comes in w/ default symbology. According to the REST docs, a Feature can come in with a Symbol property, but I don't recall ever having seen that in Arcade...

A workaround I've used is to use SVG elements and pipe in attributes to them. Like here, I have a list of features and I wanted graduated symbols in the List.

jcarlson_0-1666277635162.png

 

I had to use Advanced Formatting to scale the attribute to a pixel size that made sense, but I was satisfied with the result. Though a bit tedious, you could find SVG versions of the symbols you like, then pipe those into an expression with When(class_a, "svg string", class_b, "other svg string"...)

- Josh Carlson
Kendall County GIS
0 Kudos
DougBrowning
MVP Esteemed Contributor

@jcarlson Have you noticed if using FeatureSetByRelationshipName is faster?  In theory you would think it does the query by key server side and just returns the one record I need.

I was skipping FeatureSetByRelationshipName since it had bugs but seems to work on my data.  

Should be faster than this right?

var sql = "PlotKey = '" + $feature.PlotKey + "'";
var tbl = Filter(FeatureSetByName($map,"Soil Stability"), sql);

I tested but have not seem much difference yet.

thanks

0 Kudos
AlfredBaldenweck
MVP Regular Contributor

I've been feeling this way for a bit, too.

Even just in a normal Pro session, there are tons of things that , like Josh says, are teasingly out of reach.

Particularly, as you say, using FeatureSet outside of popups. We have all these cool things that could work (I wanted to symbolize by whether or not some points were within 3 miles of some turbines), but most profiles are completely agnostic to things other than the feature class itself.

Arcade is great at getting things dynamically. I'd love to be able to use it for quick and dirty visualization without having to make a new layer or a new feature class, but right now it just can't do what I want. I love it for field calculations and pop-ups, but visualization needs a lot more work.

Another use case I noticed last week was this post: Re: Symbolize top 10 attributes by count dynamical... - Esri Community

Why don't we have a $view global that's not just for view scale? Let us adjust symbology by what's in the view, a la DRA for raster datasets.

I second the Arcade Board idea; I'm never sure where to ask questions for it.

JohannesLindner
MVP Frequent Contributor

In regards to an Arcade community, please lend your support to this idea: Arcade Community - Esri Community

 

In regards to making featuresets available in the labeling and visualization profile: This would be great, but it's probably not coming any time soon. Post from February 2022:

There are no plans to extend the labeling or visualization profiles to include FeatureSet functionality for performance reasons. Label and visualization expressions are executed on a per-feature basis and a feature set query executed per-feature would slow down draw performance.

For this use-case the recommendation is to use a calculate attribute rule where the script is executed at data creation or update time rather than once per draw loop. FeatureSetByName can be used to perform FeatureSet lookups with any other dataset in the same workspace. Cross-database cases are not currently possible but an idea to support that for future workflows could be submitted for conversation.


Have a great day!
Johannes
DougBrowning
MVP Esteemed Contributor

Most of my stuff is using FeatureSet and intersects with a Polygon and points.  Hard to tell if attribute rules can handle that yet.  Also these go across databases for sure.  Some I use Esri layers even.  Like summarizes our data points inside HUCs from Living Atlas. So still wont work it sounds like from your text.  But for now I am AGOL which has no attribute rules yet anyway.

Bummer.  I still think if they could speed up FeatureSet it could work.

thanks

0 Kudos