I was able to use the expression below to autopopulate the ditch ID based off of the parent layer when the user adds a new maintenance log. Since updating that layer, by adding two new fields, it doesn't want to work now.
// Get the feature set for the ditches
var ditches = FeatureSetByRelationshipName($feature, 'DitchGroundProof',['SegmentNumber'], true)
// Get the first ditch (should only be one)
var ditch = First(ditches)
// If there was a ditch, return the number of it,
// Otherwise, return null
if (!IsEmpty(ditch)) {
return ditch['SegmentNumber']
} else {
return null
}
I have read that FeatureSetByRelationshipName doesn't want to work sometimes, but I can't figure out the work around.