Hello everyone,
I am new to creating attribute rules and am trying to copy a field from an intersecting feature into a specified layer in my ArcGIS Pro document in a FGDB
Essentially, I have two separate project layers that are polygon layers in the same file geodatabase. Both of them consist of projects from two separate departments.
ProjectsA - Has a project_number field for all existing intersecting project_numbers from ProjectsB
ProjectsB - Has a project_number field
I want to create attribute rule(s) that ensure that any time a new project number is written to ProjectsB, that only the intersecting polygon(s) from ProjectsA are updated with the same project number that was added or updated in ProjectsB.
I have already created an FME script that took all intersecting polygons from ProjectsB and inputted them into a project_number field in ProjectsA. I have a second project_number_display field in the instances whereby projects from ProjectA intersect with multiple projects from ProjectsB and separated each project_number with a semi colon ';', as the initial project_number field could not account for multiple project_numbers from ProjectsB.
I then created an intermediary table for all of the intersecting project_number ProjectA and ProjectB polygons, as well as duplicate records for each instance in which there were multiple project_numbers (i.e. PP2023-12; PP2023-05) for a single project from ProjectA.
I used table to relationship class geoprocessing tool to create a M to M relationship class between the two, so that whenever a user clicks on a polygon from ProjectsA, the related record will show any intersecting polygons from ProjectsB and vice versa. This includes instances where there are multiple intersecting projects from either.
I want to ensure that the relationship class is preserved when an edit/update/delete is made to either ProjectsA or ProjectsB in the future and would hope that the attribute rules would be able to preserve this relationship between intersecting polygons.
This is the current attribute rule I have set up for ProjectsA:
var ProjectsB = Intersects(FeatureSetByName($datastore, 'ProjectsB', ['project_number']), $feature);
if (Count(ProjectsB) > 0) {
return First(ProjectsB)['project_number'];
} else {
return $feature['project_number'];
}
This is where $feature will refer to ProjectsA.
This doesn't seem to update the appropriate project_number field when I create a new test polygon in ProjectsB.
Is there something that is sticking out to anybody here?
Thanks!