Select to view content in your preferred language

FeatureSetByName Not Working

405
1
Jump to solution
03-13-2025 10:25 AM
Labels (1)
SayenaMarandi
Emerging Contributor

I am working on an ArcGIS Dashboard where I want to dynamically access the Incident_Date field from the "TAG Point data" layer, which is already included in my web map inside the dashboard.

I tried using FeatureSetByName() in an Arcade expression within an Indicator widget, but I keep getting errors stating that $map, $datastore, and $data are not defined.

Here are two examples of what I tried:

var fs = FeatureSetByName($map, "TAG Point data", ["Incident_Date"], false);
var minDate = OrderBy(fs, "Incident_Date ASC")[0].Incident_Date;
return Text(minDate, "MMMM dd, yyyy");



var fs = FeatureSetByName($data, "TAG Point data", ["Incident_Date"], false);
var minDate = Min(fs, "Incident_Date");
return Text(minDate, "MMMM dd, yyyy");


But none of these work because $map, $datastore, and $data are not recognized in the Arcade Dashboard profile.

What is the correct way to reference a web map layer that is already included in my Dashboard when using FeatureSetByName() in an Indicator widget?

Any guidance would be greatly appreciated!



@DanPatterson
@JenniferAcunto
@KenBuja 

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

To return the minimum date, you'll have to use FeatureSetByPortalItem to get the layer.

View solution in original post

0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

To return the minimum date, you'll have to use FeatureSetByPortalItem to get the layer.

0 Kudos