Save Arcade Expressions

1166
5
05-15-2019 11:11 AM
Status: Open
MegHoole
Occasional Contributor III

I want to be able to save Arcade Expressions in AGO.  Business case:  I wrote an arcade expression to style a layer.  I then clicked the "reset to default style" button and saved.  And to my chagrin, it blew away my recently written arcade expression ... requiring me to rewrite the expression so that I could use it instead of the default style, after I changed my mind.

Tags (2)
5 Comments
BillSchlatter

I agree, and I would add that it would be very nice if there was an easier way to copy/access arcade expressions between layers and webmaps.  I'm working on a series of maps right now that display the same basic information in a variety of ways, and I'm probably spending more time switching between AGO tabs, opening expressions, and copy/pasting code than most of the other phases of the project combined.  One layer with a heavily-customized pop-up has 19 attribute expressions, a custom-configured pop-up that uses all of them, and Arcade-based styling. I use multiple versions of the layer at different zoom levels (zoom-based styling in AGO would also be nice, come to think of it), and keeping the pop-ups consistent between layers is increasingly labor-intensive.  

by Anonymous User

we should create an arcade expression library to save our favorites expressions

MartijnJansma

Being able to simply (re)apply an expression from a personal library would be terrific.

Being able to update an expression for all Layers within a Webmap without pushing all their seperate buttons would be the next step.

FranklinBailey

Bill Schlatter

I know you are probably past this project but for future help you can use ArcGIS Online Assistant to copy and paste the expressions between different layers. You have to be careful that you do not alter any of the other json, but it sure beats copying at pasting x amount of expressions back and forth between 2 layers in a webmap or visualization screen and having to go through creation process all over again.

DanielTaylor_GIS

I agree with everyone's comments above. I am building a web map with a lot of different infrastructure categories added as different layers. Within their respective popups I have an arcade expression asking the same question of the surrounding data.

As a result I spend my time copying and pasting arcade expressions from layer to layer. What would be cool would be having our Arcade expressions saved within our AGOL content. We do name them after all. So in practice, I could open a popup Attribute Expression editor and view a drop down menu of existing scripts. 👍

Maybe an option within the editor to "Save this expression."

That would also help in cases such as @MegHoole  described at the start of this thread.