Hello!
I have a small Arcade expression I'd like to use in a field map. It takes a feature set from the map, which is filtered from a broader feature service, and generates a "custom" id for any newly added feature.
Solved! Go to Solution.
If you wrap the feature set with a Filter and the map's definition query you can guarantee the feature count matches the map in every context.
Hey @BrianPryzby
Would there be any reason where you wouldn't be able to use GUID()?
var POI = $feature.POI_ID
if (POI != null) {
return POI
} else {
return "POI-" + GUID()
}
This would avoid the FeatureSetByName issue entirely, also generating a unique ID.
https://developers.arcgis.com/arcade/function-reference/text_functions/
Cody
Hi Cody, thanks for your response! This definitely would work as a way to generate a unique identifier, though I was looking for something a bit simpler. Just a sequential ID, POI 1, POI 2, etc. that would be unique to each map. There can be repeats within the broader feature layer
If you wrap the feature set with a Filter and the map's definition query you can guarantee the feature count matches the map in every context.
Thanks David, this worked for me! It seems a bit redundant that you'd need to place a filter on a feature set, which was itself rooted in a filtered layer on a web map. But it is what it is