

The feature class and the StructureInspection table are related by GlobalID and GUID fields.
The StructureInspection table holds all inspection fields for all Structure types. Each StructureType has different inspection fields associated with it. I need the StructureType field in the StructureInspection table populated with the value of the StructureType of the Parent feature class to be able to control what fields are visible on the inspection form in Field Maps for the specific structuretype. I don't want users to have to enter in the structure type every time for a structure inspection. The StructureType is designated with the feature when it is created, and the structure inspection table is related to the feature (through a relationship class called Structure_StructureInspection).
The datatype of the StructureType field in the parent feature class is Short (Numeric) because it has subtypes.
The datatype of the StructureType field in the StructureInspection table is Short to be compatible.
I want the StructureType value of the parent feature class to automatically populate in the StructureType field of the related child StructureInspection table when a new record is created in the StructureInspection table.
I have tried doing this using an Attribute Rule in ArcGIS Pro:
Using the Calculation Rule
I did not select a field; I want this to trigger with any field.
I have it triggering on Insert, when a record is created
The Arcade expression used:
var relTable = "StructureInspection"
var GUID = $feature.StrucInsp_GUID
var Structure = FeatureSetByName($datastore, "Structure", ["GlobalID", "StructureType"], false);
var related_inspections = Filter(Structure, "GlobalID =
@GUID");
var structureTypes = [];
for (var i in related_inspections) {
structureTypes[i] = related_inspections[i]["StructureType"];
}
return structureTypes;
I get no errors with the Attribute Rule, but the StructureType does not populate when a new record is created in the StructureInspection table.
I would love if someone could help solve why this is not working! Thank you!!!