If you aren’t yet familiar with Esri’s new scripting language ArcGIS Arcade, you may be thinking, why do I need another scripting language?
The short answer is that you may not need Arcade, but once you find out all the nifty things you can do with this simple expression language, you are going to want to use (and reuse) it.
Arcade is not a full programming or scripting language for creating stand-alone apps. It is not a replacement for automation.
Because the ArcGIS platform is all about sharing—it runs on everything from desktops to mobile devices—coming up with an expression language that could run across the platform was challenging. To run on mobile devices, the language had to be lightweight. It also had to be secure. Some fully functional scripting languages introduce security issues.
To meet these requirements, Esri developed Arcade. Named for the covered passageway, not the video game haven, Arcade follows in the Esri tradition of naming scripting languages after streets and roads (like Avenue) and including an Arc in the name.
With Arcade, you can easily perform calculations with layer fields and use the result for label expressions or data-driven visualizations. This means that when you are making a map and the layer you are using doesn’t contain the exact attribute field you need, you can generate that data on the fly without editing source data, adding a field, or permanently calculating values.
With this capability, you can turn counts into percentages, derive new values from provided data, and otherwise turn the raw data behind your map features into information for your map reader. Arcade expressions can also set rendering properties such as transparency and rotation. This is especially useful for ArcGIS Online maps. Simply choose Change Style > New Expression, and construct your expression in the scripting window.
Arcade is purposefully simple. Instead of the many programming constructs found in other languages, it has a rich library of data, logical, mathematical, geometry, date, and text functions that make it easy to do complex calculations. The Arcade team at Esri will continue to extend the language with requested functions that meet use case needs.
Because it is case insensitive, it does not matter if you mix the case of variable and function names. Arcade’s type system implicitly casts between types where appropriate using a predefined set of rules.
Use Arcade for single-line or multiline expressions. Either way, it will return the last statement even if the keyword return is not used (except in the case of custom functions). With Arcade, geospatial is a first-class citizen. Geometries can be created and referenced. Arcade has profiles for visualization, labeling, and alias. A profile is the context in which an Arcade expression is evaluated. Each profile expects different inputs and produces different outputs.
There are lots of resources for learning Arcade. In addition to the guide and function reference, the site has a playground section for testing and fooling around with Arcade expressions. Visit the site today and start learning Arcade, a simple-to-write and quick-running language that will help you easily create more powerful information products.