Currently, geofences only allow us to configure notifications or location sharing (tracking) for our mobile workers once they cross a certain threshold that we've specified and configured in the ArcGIS Field Maps Designer.
However, we may want to use a boundary polygon to restrict where mobile workers can or cannot perform edits. Two examples of this might be:
While this isn't out-of-the-box functionality within the 'Geofences' settings, we can use Arcade and conditional logic during form configuration to acheive the desired effect.
The following example uses a web map with:
When configuring the form for the edit-enabled layer, set a field to be *Required:
Then, for the same field, click on the settings cog next to the 'Editable' logic to configure an Arcade expression:
Name your expression something like 'Editable Geofence', then click on 'Launch Arcade editor', and use the following Arcade example as a guide:
var properties = FeatureSetByName($map, 'PropertyBoundaries')
var property = First(Intersects($feature, properties))
if (!IsEmpty(property)) {
return true
} else {
return false
}
This code block will be applied at the time of digitising a new point feature or performing an update to the geometry of an existing point feature in this layer. In the Arcade sample above, we use:
Click on 'Run' to test your Arcade script and check if it spits out a 'true' or false' sample value. Then save your form in the ArcGIS Field Maps Designer.
The next step is to test the behaviour in the ArcGIS Field Maps mobile app. In the GIF below, we drop a point outside the boundary polygon features and the form logic prevents our required fields from being edited, which prevents the point feature from being submitted. Once we correct the point location to intersect a boundary feature, the required fields become editable and the new point can be submitted successfully:
A few things to note:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.