Attribute Rules - Updated multiple attribute fields on same feature on the same feature row with one calcualtion rule

1532
2
06-26-2020 01:02 PM
Status: Implemented
Dominic__Dan_Palazzolo
New Contributor II

On calculation insert and update rules, allow multiple attribute columns to be updated on the same feature / row.  Currently rule hangs in a recursive loop.

If you wanted to update 6... fields on the same feature on insert / update you must create 6... rules one for each field.  This idea would allow for one rule to update multiple fields and create better performance when updating or inserting many rows

 

Ex: Both return value and update values are to the same feature and row. This hangs recursion

var currFromMeasure = $feature.FROM_MEASURE;

var currToMeasure = $feature.TO_MEASURE;

var fromMeasure = Geometry($feature)['paths'][0][0]['m'];

var toMeasure = Geometry($feature)['paths'][-1][-1]['m'];

var calFromMeasure = null;

var calToMeasure = null;

 

if (IsNan(fromMeasure) || IsEmpty(fromMeasure)) {

calFromMeasure = currFromMeasure;

}

else {

calFromMeasure = fromMeasure;

}

 

if (IsNan(toMeasure) || IsEmpty(toMeasure)) {

calToMeasure = currToMeasure;

}

else {

calToMeasure = calToMeasure;

}

 

return {

'result':calFromMeasure,

'edit':[

{

'classname': 'PODS.CLASS_LOCATION',

'updates':[

{

'GLOBALID': $feature.GLOBALID,

'attributes': {

'TO_MEASURE' : calToMeasure

}

}

]

}

]

}

2 Comments
JoeBorgione

Dominic (Dan) Palazzolo‌- be sure to vote for your own idea! 

KoryKramer
Status changed to: Implemented

This was implemented in ArcGIS Pro 2.7 and ArcGIS Enterprise 10.9.

See https://community.esri.com/t5/attribute-rules-videos/update-multiple-fields-with-a-single-attribute-... for a demonstration and further resources.