Select to view content in your preferred language

Adjust Arcade to calculate field in Pro

388
0
02-14-2024 09:02 AM
SDague_FSMAR
New Contributor II

I have an Arcade expression in a web map to give a total length of lines with a matching ID attribute.  I want to modify this Arcade expression to work in a Field Calculation to take the calculated length and write it to a new attribute.  I am having trouble converting it.  I assume I need an array or FeatureSet, but I am unsure of the correct syntax. If possible to have the FSRound portion below use a stored length vs geodetic length that would be great.

This is for gravity mains that have various segments between manholes and our engineers want to see the total length between manholes.

var parent = $feature.ParUS_DS_MH
var sql = "ParUS_DS_MH ='" + parent + "'"
var FS = (Filter($layer, sql))
var FSRound = LengthGeodetic(FS, 'feet')
return Round(FSRound, 2)

In the attachment, you can see the total length even though the selected line is much shorter.

Any help is appreciated.

Tags (3)
0 Kudos
0 Replies