Learning a New Language: Arcade Basics

Hunter Ray, GISP

Technical Services Manager

Learning a new language can be intimidating at first, because it’s hard to find your bearings. This blog aims to help you over the hurdle of learning Arcade basics.

So, What is Arcade?

Arcade is a portable, lightweight, secure expression language developed by Esri to enhance workflows and user experience within ArcGIS applications. Arcade base functions mirror the look and feel of JavaScript. Arcade expressions can be used to access feature sets, individual feature attributes (including geometry) and to perform mathematical calculations, format text, and evaluate logical statements. It also supports multi-statement expressions, variables, and flow control statements.

Where to use Arcade?

Arcade can be used across the Esri Platform in ArcGIS Pro, ArcGIS Online, ArcGIS Enterprise, Runtime SDK’s, and the ArcGIS API for JavaScript. Inside these applications, Arcade expressions can be used to enhance layer symbology, labels, and popups. One new and exciting use case for Arcade is in the Map Viewer Forms that work with the Field Maps mobile app and the Experience Builder Editor Widget to show/hide fields and calculate values for fields.

How to use Arcade?

Before you start writing an Arcade expression, review the Profiles page for the profile you intend to use the expression with. Each profile has a unique set of functions that will work in them, so it is important to know what’s possible before you get too far along in an expression only to realize you can’t use the function you need. Within these profiles are function bundles, which are the functions available to you within that specific profile. By checking that the functions you will need to perform your expression are included, you can save yourself a lot of time later. For example, if you were going to create an expression for labeling in a web map, you would want to review the Labeling Profile, where you will see the only Profile Variable available is the Feature ($feature), and the function bundles available for use only includes those function in the Core and Geometry bundles.

Conclusion

After reviewing the background structure of the Arcade expression language and how it’s used, you can start to create, test, and debug your first expression in your app of choice. Aside from the recorded YouTube video of this webinar, a great place to see examples of expressions in real-world scenarios is Esri’s Arcade Blog. On the Arcade Blog page, you’ll find one of my favorite posts here which shows common expressions used to streamline data collection and editing in the Field Maps app.