I am developing a ward-based Survey solution using ArcGIS Field Maps in ArcGIS Enterprise 11.5.
The setup includes:
A point survey layer for data collection
A ward boundary layer
A user assignment table that maps each surveyor to a specific ward
Requirement:
Each surveyor should only be able to submit points within their assigned ward. For example, Surveyor 1 should only collect data in Ward 1, and Surveyor 2 in Ward 2. If a surveyor collects data outside their assigned ward, the system should indicate whether the entry is correct or incorrect. It should not allow the user to submit the records as well based on it.
I implemented a field called location check using an Arcade expression to validate this logic.
However, while the expression works partially, it does not fully enforce the restriction or behave like a true geofence. Instead, I either get a message or a required field warning.
I am currently using this Arcade expression:
// Current surveyor name
var currentUser = Lower(Text($feature.name_of_surveyor));
if (IsEmpty(currentUser)) {
return "User not found";
}
// Current point
var pt = Geometry($feature);
if (IsEmpty(pt)) {
return "Point geometry missing";
}
// User assignment table
var assignmentFS = FeatureSetByName(
$map,
"User Logs",
["username", "ward_no"],
false
);
// Assigned ward
var assignedWard = null;
for (var row in assignmentFS) {
if (Lower(Text(row["username"])) == currentUser) {
assignedWard = Text(row["ward_no"]);
break;
}
}
// No ward mapping
if (IsEmpty(assignedWard)) {
return "No Ward Assigned";
}
// Ward polygon layer
var wardFS = FeatureSetByName(
$map,
"Ward Boundary",
["ward_no"],
true
);
// Intersect check
var intersectWard = Intersects(wardFS, pt);
for (var ward in intersectWard) {
if (Text(ward["ward_no"]) == assignedWard) {
return "Field Worker entered in the correct Ward";
}
}
return "Field Worker entered Incorrect Ward";
The validation is not fully working as expected in Field Maps, and it does not behave like the geofencing example shown in Esri documentation I followed : https://community.esri.com/t5/arcgis-field-maps-blog/configure-an-editing-geofence-in-your-form-using/ba-p/1567096
What is the recommended approach to properly enforce user based ward-level restrictions in ArcGIS Field Maps