This story map requires JavaScript, but running JavaScript is not currently allowed by your web browser. If you wish to view this story, please enable JavaScript in this browser or try a different browser.

How to Smart Map: Arcade

Dynamically transform your data using Arcade expressions

Add your image or video

This quick guide introduces Arcade expressions and how to use them to customize your ArcGIS Online maps.

What is Arcade?

Arcade is an expression scripting language which can be used across the ArcGIS Platform on feature layers. It can perform mathematical calculations, manipulate text, and evaluate logical statements using your data. 

This means that you no longer have to go back to your data and calculate (or re-calculate) a new field if you want to visualize a new pattern.

Arcade transforms your data values on-the-fly and can be used for your map symbology, labels, transparency, pop-ups, and symbol rotation. Do basic calculations, convert field types, and even create complex equations using your data. All without leaving the map.

Create custom calculations on-the-fly and immediately see the result in your map

For example...

Within Map Viewer I have data from the US Census Bureau with 2000 and 2010 population counts. Traditionally, I'd have to own the data layer, go back to ArcGIS Pro, and calculate a new field in order to see the change in population between the two years. However, with Arcade, I can do this on-the-fly by creating an expression directly within the map. 

To map a new value using an expression, choose "New Expression" at the bottom of your attribute list:


The expression window will appear on the screen.  The equation for change over time is ( (new - old) / old ) * 100, so I simply type this into the Expression window using the existing attributes from the data.

Arcade will map the resulting value from this expression, so now I can make adjustments to the cartography and show my new "Change in Population from 2000 to 2010" value. I chose to set 10% growth as dark blue, and 10% decline as dark red.:

Apart from your cartography, Arcade can also be used in the following ways within Map Viewer:

Transparency

Let certain things on the map to stand out more clearly than others. Arcade can help you decide which things on the map to “fade” into the background a bit.

Labels

Sometimes your attributes need a little help, even if it’s just to add something to them like “$” to make “124” say “$124” or to make “50014314” say “~5 million passengers”

Symbol Rotation

Rotate an arrow or other map symbol based on a calculation, like % growth/decline

Pop-ups

Turn rows and columns of data into readable explanations, with colorful displays.

Using Arcade

Use Arcade to calculate or convert your attributes. The Arcade window contains your existing attributes, which you can use to calculate new values. 

The graphics below introduce the basic layout of the Arcade window:

For a full list of the Arcade functions, click here

For example...

I have a dataset of energy pipelines in Indiana. One attribute I'm interested in mapping is the diameter of these pipelines. Unfortunately, this value was hosted as a text field rather than a number. Previously, I would need to go back to my data table and calculate a new field using a numeric field type.

Fortunately, I have the power of Arcade to transform this attribute on-the-fly! There is a Number() function which easily makes this conversion.

Smart mapping will recognize the result of the expression as a numeric value, so now I'm able to visualize the width of the pipelines using the size of the symbols:


Step-by-Step Example

The following scenario walks through a few of the ways Arcade can be accessed within Map Viewer. In this example, I'll create a map from scratch. Keep these techniques in mind when working with your own hosted data.


Try it Today!

Arcade expressions open many doors for the customization of your maps. Save time and processing steps by writing simple (or complex) expressions to showcase your data. The possibilities are endless!

Everything you've seen in this story map can be configured within a web map and used "as is" in a configurable app or custom app. Developers can do even more by working within the API. See the blogs for developer examples.

To learn more about Arcade, check out the following resources:

Getting Started with Arcade

ArcGIS Arcade Documentation Pages

ArcGIS Blogs about Arcade Expressions

Arcade Function Reference

For more inspiration, check out the resources and maps below to see how others are using Arcade within their maps and apps. 

An error has occurred

2%