Reusing an Arcade Expression in multiple layers in Map Viewer

09-27-2021 08:27 AM
Labels (1)
New Contributor II

I'm creating a web map for Conservation and Heritage features in Lancaster district, UK, and am using Arcade expressions to create hyperlinks to relevant policy web pages and PDF documents. There's 2 or 3 Arcade Expressions that I am repeating in 10 of my layers. As web address and document locations can change I thought it would easier to write an Arcade Expression that could be used repeatedly in different layers.

Is there a way to write an Arcade Expression that can be used for different layers in the same web map? I'm currently copying the same expression into each individual layer, which isn't very time saving or robust as just updating the URL in the attribute tables.

Also, how do people save their Arcade Expressions for using in different projects? I'm new to Arcade and looking for ideas to store useful snippets.


0 Kudos
1 Reply
Occasional Contributor III

I guess something you could do is make a master table of website and Document URLs and then have the Arcade expressions point to that? That way all you have to do is change the URL in the table and it would update everywhere at once.


Regarding saving the expressions: I have mine in text files, as well as saved in each layer in Pro. Be warned that the layer is only for that instance of it; if you remove the layer and re-add it, the expressions will be lost.