The feature class and the StructureInspection table are related by GlobalID and GUID fields.
Something like this should work:
// Calculation Attribute Rule on hte inspection table
// field: StructureType
// triggers: Insert, Update
// depending on how you create your inspection record, it won't be able to find the parent feature on Insert, so you should also trigger on Update
// optional: abort if there is already a value in the field
if(!IsEmpty($feature.StructureType)) { return $feature.StructureType }
// get the parent feature
var parent = First(FeaturesetByRelationshipName($feature, "Structure_StructureInspection"))
// if a parent feature was found, return its StructureType, else return a default value
return IIf(parent == null, "no parent found", parent.StructureType)
Hi Johannes! Thank you for taking the time to respond to my question, I greatly appreciate it! Based on your suggestions, I selected the StructureType field from the StructureInspection table in the Field box for the Attribute Rule. This is where I want the output of the expression to be stored (the value of the StructureType field). I added your code in the expression box. Added the trigger update so now have Insert and Update triggers. I checked exclude from application evaluation. I saved it. The attribute rule turned green. I published my layer. Created a web map with forms in ArcGIS Online. Opened my webmap in Field Map App. I created a structure feature and then created a new record in the structure inspection table and the StructureType will not autopopulate with the StructureType from the parent feature class. Someone suggested I uncheck the Exclude from application evaluation, so I went back into my ArcGIS Pro Project and unchecked the Exclude from application evaluation, and now when trying to create a new Attribute Rule, after saving it turns gray instead of green. I deleted the attribute rule and created a new one and I am still getting a gray box instead of green after saving.