Greetings all,
Yet another query about populating a related table field from the parent feature layer table via a calculated expression. I’ve followed the video below, checked it three times and worked through all ChatGPT suggestions but can’t get this to work. It runs in the Field Maps form test and returns null but fails completely in Field Maps when adding a record to the related table. Yes, the relationship class name is odd because it was published from a QA portal environment. Might that be the issue? I’ve not tried replacing the relationship class. If I replace the relationship class will that affect the form I’ve created? My logic says no since it’s only a connector but thought I would ask the community before hand. Many thanks in advance for any insight.
Note: The field I'm trying to populate, “LOCATION_ID”, does exist in both tables and is not the key between tables. (Those are Globalid in the feature layer and GUID field in the related table.) Also, I am not creating new features, only inspecting existing locations so cannot apply an attribute rule.
Using Calculated Expressions with Related Records in ArcGIS Field Maps - YouTube
Expression:
var locid = FeatureSetByRelationshipName($feature, "GISDEVREAD.DrainageClearingLocations", ['LOCATION_ID'])
var feature1 =First(locid)
if (!IsEmpty(feature1)) {
return feature['LOCATION_ID']
} else {
return null
}
Scott G