Hello everyone,
We are currently working to migrate some versioned editors using SQL Server / replication and ArcGIS Desktop, to ArcGIS Pro and feature service. This group uses Attribute Assistant, so I'm working to migrate this functionality to Attribute Rules. So far everything is going pretty well. I have hit one snag though...
I'm trying to create an attribute rule that will:
The issue I'm having is general evaluation failure when trying to execute the rule upon an edit as formatted below. The expression validates and saves without issue however. I know everything up to and including line 24 is working as we get th expected "s011" value which should match the sequence name/ID.
// Value to copy from the intersected feature
var intersecting_field = "FIPS";
//Field rule is assigned to in the Attribute Rule
var feature_field = $feature.SEQUENCE;
// Create feature set to the intersecting class using the GDB Name
var intersecting_featset = FeatureSetByName($datastore, 'VA_COUNTY_BOUNDARY_STG', [intersecting_field], true);
var search_feature = $feature;
var intersected_feature = First(Intersects(intersecting_featset, search_feature));
// Check to make sure there was an intersected feature, if not, return the original value
if (intersected_feature == null)
{
return $feature.FIPS;
}
// If the intersected feature is null, return the original value
if (IsEmpty(intersected_feature[intersecting_field]))
{
return $feature.FIPS;
}
var sequenceID = 's'+intersected_feature[intersecting_field];
var id = NextSequenceValue(sequenceID);
return id
Apologies as I'm still somewhat new to Arcade- but it is not possible to pass a variable value into a function? We have around ~130 sequences based off of FIPS so listing them out individually would be...not ideal.
Thank you for any help or tips you can provide!
Solved! Go to Solution.
Well...this was a classic case of user error. It helps if you create the database sequences in the correct database. Once I created the test sequences in the appropriate geodatabase...it worked like a charm. Thanks folks!
Well...this was a classic case of user error. It helps if you create the database sequences in the correct database. Once I created the test sequences in the appropriate geodatabase...it worked like a charm. Thanks folks!