Select to view content in your preferred language

Arcade and Shape_Length

1182
4
Jump to solution
07-08-2022 05:26 PM
LorenMueller
Occasional Contributor

(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:

LorenMueller_0-1657679276378.png

 

(Esri 10.9.1, Pro 2.9.3)

0 Kudos
1 Solution

Accepted Solutions
HusseinNasser2
Esri Contributor

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_0-1658422353310.png

 

 

View solution in original post

0 Kudos
4 Replies
LorenMueller
Occasional Contributor

@HusseinNasser2  - nothing? 🙂

0 Kudos
JohannesLindner
MVP Frequent Contributor

These work for me...

 

For FGDB:

return $feature.Shape_Length

 

For EGDB (SQL Server):

return $feature['Shape.STLength()']

 


Have a great day!
Johannes
0 Kudos
HusseinNasser2
Esri Contributor

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_0-1658422353310.png

 

 

0 Kudos
LorenMueller
Occasional Contributor

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.

0 Kudos