(reposting to this group. original post to the data management group, but not much response)
I am trying to create an Attribute Rule that on record update in a line feature class that grabs the value in Shape_Length and copies it into another field. But in the Arcade text editor when choosing the Shape_Length field, it populates the script with $feature['Shape.STLength()'], the underlying method that populates that field in the db. Well, when the system tries to evaluate the rule upon record update, it errors out saying that it can't find the field [Shape.STLength()]. Well yeah, that is not a field, it is an ST geom method. How does one get the current value in Shape_Length without calling the underlying ST geom method? The Length() method leaves me a bit nervous because of the caveat of changing the results based on the scale of the map!? Yikes. And the projection I am using is NAD 83, so I can't use the LengthGeodetic() method. Any ideas greatly appreciated.
For reference, screen caps of a line Feat Class field def in both an Ent GDB (SQL Server) and a FGDB:
(Esri 10.9.1, Pro 2.9.3)
Solved! Go to Solution.
It looks like a bug reading the shape_length st function in the client side. I assume you are consuming the SQL Server feature class through a feature service? I can't reproduce this when running direct connect.
We will look into it, meanwhile as a workaround, try Excluding the Attribute rule from application evaluation and restart the service, that should do it. That will skip the client side evaluation and only do server side which we know it works.
@HusseinNasser2 - nothing? 🙂
These work for me...
For FGDB:
return $feature.Shape_Length
For EGDB (SQL Server):
return $feature['Shape.STLength()']
It looks like a bug reading the shape_length st function in the client side. I assume you are consuming the SQL Server feature class through a feature service? I can't reproduce this when running direct connect.
We will look into it, meanwhile as a workaround, try Excluding the Attribute rule from application evaluation and restart the service, that should do it. That will skip the client side evaluation and only do server side which we know it works.
That was it @HusseinNasser2 . Yes, reading/editing via the Feat Svc. Excluding from client eval works. I think that this solution will work for my use case, but perhaps others will need this to work via client eval in the future, so thank you for sending the issue to the Pro team.