I have set up a attribute rule Calculation that will run on evaluation. I am using a enterprise setup (SQL database, Portal, REST endpoint) I published the data with "reference registered data", "Exclude from application evaluation" enabled, global IDs enabled, schema locking, I have both Map Service and a Feature Service, but I didn't enable versioning or archiving.
All the data is in the same database, but the points are under a Feature dataset and the polygons are not, but they are in the same projection.
This attribute rule evaluates successfully when I am editing normally through a GDB connection, in ArcGIS Pro, but when load our feature service and edit the attributes I get the following error:
Arcade error: Geometry type or null expected
I don't think its a geometry error because it runs fine when I don't use a feature service. It seems more like the geometry is not accessible when you use a feature service.
I have the following Arcade script:
// bring in the data and filter out abandoned valves
var valve_set = filter(featuresetbyname($datastore, 'GasValves', ['OBJECTID', 'WORK_ORDER_STATUS', 'ABNADONEDFLAG'], true), "ABNADONEDFLAG = 0")
// make the query for all closed work orders
var query = "WORK_ORDER_STATUS = 'CLOSED'"
var closed_valve_set = filter(valve_set, query)
//check if query is a empty feature set
if (closed_valve_set != null) {
// return feature set counts
var closed_count = count(Intersects($feature, valve_set)) - count(Intersects($feature, closed_valve_set))
return closed_count
}
// return null if empty quadrant
else { return null }
Regards,
Jim