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