Hi All,
Thank you for your support with this.
I have several fields in a data layer that I have programmed to auto-populate with a value. For example, the name of an overlapping polygon. The function runs fine in the web designer and usually runs fine in the app.
Sometimes in the Field Map app- the value fails to populate. If this happens the field technician is unable to submit the point/ form. The field is not required so it should be able to submit without the data there.
Does anyone have an explanation for why the auto-population would fail and a workaround to still be able to submit the form if the programming does fail?
This is some example script that I am using:
// Create a feature set using the 'POPREF' layer in the map
var regions = FeatureSetByName($map, 'POPREF', ['POPREF'])
// Intersect the current location with the regions and
// get the first region
var region = First(Intersects($feature, regions))
// If the current location does intersect a feature,
// return the name of the region. Otherwise, return null
if (!IsEmpty(region)) {
return region['POPREF']
} else {
return null
}
Thank you for your support!