Regarding this code sample from the attribute rule docs: (Mark another feature as requiring evaluation)
//Updating the substation name marks its transformers as requiring calculation and updates the yearName to the new name and year.
//To recalculate the facility id on all transformers, mark all associated transformers as requiring calculation.
var fsDevice = FeatureSetByName($datastore, "Transformer", ["globalid"], false)
var fsDeviceIntersects = Intersects (fsDevice, Geometry($feature))
var transformers = [];
var count = 0;
for (var i in fsDeviceIntersects)
transformers[count++] = i.globalid;
var newName = $feature.name + " " + Year(Now())
return {
'result': newName,
'calculationRequired':
[
{
'className':"Transformer",
'globalIDs': transformers
}
]
}
How does this line work? transformers[count++] = i.globalid;
Is it populating a "count" element in the transformers array with a list of global IDs? And then returning the entire transformers array in the result?
If so, I don't think I realized ++ could be used that way. Thanks.