The Arcade expression below works in ArcGIS Online. How do I get the Arcade expression to work in ArcGIS Pro before publishing my map service map to be used in ArcGIS API for JavaScript? I get an error saying "Invalid expression. Error on line 2. Object not found $map)." I also tried $datastore instead of $map. When I use $datastore, do I need to list the entire path to the feature class?
I am trying to find the max RatingDate for each RoadID, so the symbology displays the PSC for the most current rating date.
var currentFeatureRoadID = $feature.RoadID
var featuresSurfCond = FeatureSetByName($map,'Surface Condition', ['RoadID', 'RatingDate', 'PSC'], true);
var featuresSurfCondFilter = Filter(featuresSurfCond, 'RoadID = @currentFeatureRoadID')
var maxRatingDate = max(featuresSurfCondFilter, 'RatingDate')
if ($feature.RatingDate == maxRatingDate) {
return $feature.PSC
}
Solved! Go to Solution.
The short answer: you don't!
Arcade has a number of different profiles, each with different capabilities. The symbology profile in particular does not allow accessing other layers, either in the datastore or the map.
The short answer: you don't!
Arcade has a number of different profiles, each with different capabilities. The symbology profile in particular does not allow accessing other layers, either in the datastore or the map.