Select to view content in your preferred language

Export to CSV broken when using Arcade Attribute Expression

539
2
03-05-2023 12:59 PM
Labels (1)
suburbanMapper
New Contributor II

Hi all,

I have a web app utilizing the "Export to CSV" functionality in the Attribute Table widget. I have insured this is checked-on in the widget settings.

suburbanMapper_0-1678049648151.png

I am also using Arcade Attribute Expressions to calculate some fields in the pop-up that will also be available in the attribute table and subsequent CSV. This works as expected until I add the expressions below. Then the export to CSV freezes and never completes. The expressions buffer a linear feature and return the lat/long of the centroid. 

Latitude
var PatchBuffer = Buffer($feature, 10)
var PatchCentroid = Centroid(PatchBuffer)
return round(PatchCentroid.Y, 6))

Longitude
var PatchBuffer = Buffer($feature, 10)
var PatchCentroid = Centroid(PatchBuffer)
return round(PatchCentroid.X, 6)

Attibute expressions are being leveraged for a number of other fields and these are exporting as expected. The exports fail when the above expressions are added.

I have isolated the problem but am a little lost on how to resolve it. Any ideas are welcome.

0 Kudos
2 Replies
DavidGrafton_BadElf
New Contributor

Have you tried just using the geometry attributes of the feature?  Is the buffer doing anything here?

i.e

var lat = geometry($feature).y

var lon = geometry($feature).x

0 Kudos
suburbanMapper
New Contributor II

Hi,

The features are linear, so they do not have an explicit X/Y available.

The buffer is creating a polygon to get the centroid lat/long. 

It appears this is a known bug, BUG-000131959. I was hopeful someone had a workaround.

 

0 Kudos