Unable to use Field Calculator with "SHAPE__Length" as an expression variable

1659
4
Jump to solution
01-03-2022 04:01 PM
Labels (1)
josh_is_fine
New Contributor III

I'm trying to multiply "SHAPE__Length" by another numeric field, "width". Both fields are type double.
When doing this in Portal, I don't receive any errors. It just doesn't calculate. It will calculate other values and fields, as long as it's not using "SHAPE__Length".
When attempting this in Pro, I get the generic ERROR 999999 fail code.

I have a workaround in Pro:
With Calculate Geometry, set target field = length.
With Field Calculator, set the same target field = (target field * width field)

I would still like to know what I'm doing wrong with the original workflow.

 

1 Solution

Accepted Solutions
josh_is_fine
New Contributor III

IT figured out a fix. Use this in place of "SHAPE__Length" for any (Arcade) calculation:(Number($feature.SHAPE__Length)

View solution in original post

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

Check your table for the correct field name it appears that you have 2 _ (underscores ) in the name and usually it appears like 

Shape_length


... sort of retired...
0 Kudos
josh_is_fine
New Contributor III

@DanPatterson, This is how the field name is generated for online content, with two underscores. When creating the layer in AGO/Portal, or even uploading a layer from Pro.

Josh_OG_0-1641322342754.png

 

0 Kudos
josh_is_fine
New Contributor III

I was able to successfully perform this task using AGO content. It seems to be a bug/limitation with Portal content.

josh_is_fine
New Contributor III

IT figured out a fix. Use this in place of "SHAPE__Length" for any (Arcade) calculation:(Number($feature.SHAPE__Length)

0 Kudos