Select to view content in your preferred language

Help with new attribute rule "Triggering Fields"

381
4
11-18-2024 02:18 PM
MDB_GIS
Frequent Contributor

I am trying to write an attribute rule that compares a parcel's calculated area to the stated (deeded area) and if it is off by more than 10% of the total acreage to flag an attribute field for it. This rule does that:

 

//If the absolute value of error acres is greater than 10% of the stated acres, then report mismatch. Otherwise, report that it is acceptable.
var QAQC_Eval = iif(abs($feature.ERROR_ACRES) > ($feature.StatedArea * 0.10), "Acreage mismatch. Deeded acres and calculated acres do not fall within OCGIS tolerance.", "Acreage ok. Deeded acres and calculated acres fall within OCGIS tolerance.")
return QAQC_Eval;

 

The problem I am having is that there are sometimes exceptions where I need to be able to manually clear the flag and mark it as an exception (like in cases where I have looked at the issue but can't correct it due to insufficient information or some other problem). 

I would have thought that if I had checked the "Editable" box in the attribute rule configuration, that this would allow me to manually change this value if required. Unfortunately, that doesn't seem to be the case because when I manually change that field, I get an error message saying "Edit Operation failed - no edits producing database changes were found." Here is the current rule configuration panel:

MDB_GIS_0-1731967448097.png

Ideally, this rule will only fire off if the geometry is changed, which is why I only have the "Shape" field set to active. Would really appreciate some help with this as this could really improve the QAQC process for our parcel data!

 

0 Kudos
4 Replies
ChelseaRozek
MVP Regular Contributor

Were you able to figure this out? I think I'm having a similar issue. I only have SHAPE as the triggering field, but making an attribute change still triggers it so I can't manually edit an attribute.

0 Kudos
MDB_GIS
Frequent Contributor

Yes. Chat GPT ended up helping me figure it out! I ultimately came up with the following expression: 

//Detect changes
var geomChanged = !Equals(Geometry($originalFeature), Geometry($feature));
var areaChanged = $originalFeature.StatedArea != $feature.StatedArea;
var areaIsZero = $feature.StatedArea == 0;

//If the stated area is zero, let user set QAQC_Status Manually
if (areaIsZero) {
    return "Unable to QAQC. New Plat needed. See comments on parcel "
}
//otherwise, if geom or area changed, run the QAQC test and set accordingly.
if (geomChanged || areaChanged) {
    return iif(
        Abs($feature.ERROR_ACRES) > ($feature.StatedArea * 0.10),
        "Acreage mismatch. Deeded acres and calculated acres do not fall within OCGIS tolerance.",
        "Acreage ok. Deeded acres and calculated acres fall within OCGIS tolerance."
    );
}

 I have the triggers set to Insert and Update, and the only update fields are Shape and the Stated Area field so it automatically updates itself should the deeded acreage change. I've been using it for about 3 months now and it has worked without issue!

0 Kudos
ChelseaRozek
MVP Regular Contributor

Thanks for sharing your code! Using that originalfeature vs. feature geometry is the only workaround I've found too, but it's unfortunate that the rule still seems to fire all the time. My bulk attribute updates take forever and it's a hassle to wait until after hours, turn off the service, disable all the rules, and then do it... I've put in a ticket with ESRI, I'll post back here if anything productive comes from it.

0 Kudos
MDB_GIS
Frequent Contributor

Yeah. That's weird. On my end, using the above code only triggers the rule when the shape changes or the deeded acreage changes. Otherwise, it never fires. 

0 Kudos