Hi, I am attempting to collect repeated inspection data for the first time. I have a tree feature class with a related table of measurements. We have equipment installed on each tree that will be re-measured biweekly.
I would like to:
1. Pull the previous measurement entered into the related table the week before into a field of the related table to perform a calculation check. (There is a 'measure' field and a 'prevMeasure' field).
2. Create an alert for the field crew to real-time 'see' that a measurement is out of range. (There is a 'measurementCheck') field.
I have found all sort of documentation to extract a value from the related table to the Parent feature class and can successfully show those values in a text box on the feature class pop-up.
It doesn't seem that you can use $editcontext.editType == 'INSERT' to return the $originalFeature on a related table.
It would be really helpful to show the field crew if there is a measurement error immediately. Is there a way to pull in a past measurement to the new record of a related table? I have tried the code below, and the value does return when running it in Field Maps Designer, but the app freezes when I attempt to 'Add' a new record to the related table...
var prevData = OrderBy(FeatureSetByName($datastore, "1", ['measureDate', "prevMeasure"], false), "measureDate DESC")
var f = First(prevData)
Console(f)
return f.prevMeasure
Thank you!