Hello, all,
I have a point layer ("Postfire_Planting_Data") that contains a field called Plot_ID and a related table ("Postfire_Monitoring_Data_Related") (1:M) that records updates to the original point. I'd like to auto-populate a Plot_ID field in the related table form using the Plot_ID from the parent layer. The layer and table are related via GlobalID (layer) to GUID (table). The ArcPro project GDB calls the relationship "Postfire_Planting_Data_Postfire_Monitoring_Data_Related". The layer, table, and relationship class were uploaded to AGOL, and I used FM Designer to create forms for the parent layer and the related table.
The Plot_ID field in the parent layer always is filled in. I want to pull that ID from the parent layer into every related table entry associated with a point in the parent layer.
I saw a number of variations of Arcade coding that supposedly would do this, but none have worked for me. Here's my last attempt, which tests in FM Designer to return "null" but on the FM app related table form says it can't calculate a value.
var parent_features = FeatureSetByRelationshipName ($feature, 'Postfire_Planting_Data_Postfire_Monitoring_Data_Related', ['Plot_ID']);
var parent_feature = First(parent_features);
if (!IsEmpty (parent_feature)) {return parent_feature ['Plot_ID']} else {return null}
Since the Plot_ID field in the parent layer always is filled in, I tried replacing the 2nd and 3rd Arcade lines above with just "return parent_features ['Plot_ID']", but that didn't work either.
Surely this is a common problem with an obvious solution. I just can't find one that works!
Any help would be appreciated.
Thank you,
Dan Gruber