I am trying to populate the fields of my related table from the attributes of a feature class.
This would be in order to create workflow that retains previous data for the position within the table, before the feature class it updated. Ideally, the user opens the form for the related table, that auto populates and captures the current data. Then they update the feature class, retaining the previous data in the table.
I am unable to achieve this currently. I tried to use 2. from this Common calculated expressions for ArcGIS Field Maps.
But can't get it to work.
The site is on a grid, so I first tried to auto populate the grid number from the polygon into the related table for management of data. I have put the following into the calculated expression of the table itself:
var parentgrid = FeatureSetByRelationshipName($feature, 'HSV_Record', ['GridSquare'], false)
var relatedgrid = First(parentgrid)
if (!IsEmpty(relatedgrid)) {
return relatedgrid['GridSquare']
}
else {
return null
}
Where am I going wrong?
Thanks.
More details attached.