In case anyone is interested, here is an Arcade expression I created to work around the 11.2 limitation. You will need to:
- add the closureglobalid field to the Blocks and Detours forms
- set the field visibility to hidden
- make sure editing is disabled
- set the field to not required
- create a new Arcade expression using the code below and assign it to the closureglobalid field
// This expression is intended to be used with
// Road Closures version 2.0 for ArcGIS Enterprise 11.2
// Set the field names from the Closures layer
var closureidField = 'closureid';
var globalidField = 'globalid';
var createddateField = 'created_date';
// Set the buffer distance and units
var bufferDistance = 10;
var bufferUnits = 'meters'
// Get the closure features
var closures = FeatureSetById($datastore, 1, [closureidField, globalidField, createddateField], true);
// Get an array of all closures within the specified buffer distance
var intersectingClosures = Intersects(closures, Buffer($feature, bufferDistance, bufferUnits));
// Check to see if any closures were intersected
if (intersectingClosures != null){
var lastCreatedDate;
var lastClosure;
// Loop through all the intersected closures and return
// the GlobalID of the most recently added closure
for (var closure in intersectingClosures){
// Get the created date from the first intersected closure
if(lastCreatedDate == null){
lastCreatedDate = closure[createddateField];
lastClosure = closure;
}
// Compare the last closure the the next one in the loop
// and keep the most recent one
else{
if (lastCreatedDate < closure[createddateField]) {
lastCreatedDate = closure[createddateField];
lastClosure = closure;
}
}
}
// Return the GlobalID for the most recent
// intersecting closure
return lastClosure['globalid'];
}
"Not all those who wander are lost" ~ Tolkien