ArcGIS Field Maps

ArcGIS Field Maps: Get Started with ArcGIS Arcade

Introduction to ArcGIS Field Maps and ArcGIS Arcade 

ArcGIS Field Maps is an all-in-one app that uses data-driven maps and mobile forms to help workers perform data capture and editing, find assets and information, and report their real-time locations. ArcGIS Arcade is a portable, lightweight, secure, and geospatial expression language used to create custom content in ArcGIS applications  

Arcade’s portability allows it to be used across the ArcGIS system. For example, a popup created in ArcGIS Pro can be shared to ArcGIS Online and the functionality will remain consistent between the two applications. Arcade is lightweight in that it’s not a full programming languageit’s closer to a spreadsheet cell calculation. It’s easy to use, but it’s also very powerful and runs quickly. Because it’s not a full programming language, it’s secure, and the security of your systems can’t be compromised by Arcade. Arcade is geospatial, which means you can access GIS information and query items using spatial methods in your expressions.  

What are some of the benefits of using Arcade in your GIS? First, it’s easy to get started. We have extensive documentation online, and if you haven’t visited the Arcade Resources page recently, you might want to take a look, as we have revamped the site so it’s more intuitive, especially for those who may be new to Arcade. There are also lots of sample expressions on GitHub to help you get started. Getting started with Arcade can be as simple as writing a one-line expression, allowing you to start small. 

Using Arcade means you can calculate outputs on the fly. This is especially helpful if you have data that changes frequentlyyou don’t have to go into the table on the backend and run field calculations each time data is updated. This can be useful when creating symbology and labels to draw attention to locations or assets that need to be addressed quickly. This also means you don’t have to worry about changing your schema. For example, if you want to add information in your popups thats a concatenation of two fields, you’ll need to go through the whole process of adding a new field and running the field calculator. With Arcade, you can create expressions that will give you the same results without having to do all the messy work on the backend. That also means you don’t have to own the data youre working with. For example, if you add a demographic layer from ArcGIS Living Atlas of the World to your map, you can still use Arcade to help you symbolize that data to meet your needs and you can use calculations on fields in that layer for your popups and labels. 

Arcade Basics 

Before we get into the details of where and how you can use Arcade, let’s go over a few of the basics of the Arcade Editor. You can build, test, name, and reuse expressions, access variables and functions, and view suggestions and help for improving your expressions. 

Arcade Editor found in ArcGIS Online and ArcGIS Enterprise.

The variables in the Arcade Editor are helpful for pulling in information from the layers and tables in your map and even those that aren’t in your map. Variables are the attributes that you want to use with your Arcade expressions. Functions allow you to do something with those variables – for example, change all caps text to title case, meaning only the first letter of each word is capitalized. Functions are listed by type, such as constants, date, geometry, text, and more. Functions are also searchable, so you don’t need to scroll down a long list if you know what you’re looking for. The Help panel opens the Arcade documentation site with more information on how to work with Arcade. Looking back at the expression window for a moment, when writing your expressions, you can take advantage of the Intellisense feature—as you type, Intellisense will make recommendations based on what you have entered in the editor.  

Where can you use Arcade? The short answer is across the ArcGIS system, and most functionality is available even when you’re working offline. You can use Arcade in ArcGIS mobile apps such as ArcGIS Field Maps, ArcGIS Workforce, and ArcGIS Navigator. You can use Arcade in web maps in ArcGIS Online and ArcGIS Enterprise as well as in mobile map packages (MMPKs), and Arcade is also available in ArcGIS Pro.  

Use Arcade with Field Maps

How can you use Arcade in ArcGIS Field Maps? You can use Arcade expressions to alter symbology, format labels, extend pop-ups, and improve smart forms. For example, you can use Arcade to do the following: 

Symbology and labels

By using Arcade to modify symbology, we can create categories from a single field—such as in this example expression using a date calculation to show how recently an area with an invasive species of plants was treated: 

Resulting legend with symbology based on treatment status.

You can also use Arcade to format rich text labels with simple calculations, such as converting miles per hour to kilometers per hour. Or you could classify your data into categories, such as in the treatment area example above.  

Tips for mobile apps

Since we are looking specifically at Field Maps, here are a few tips about labels and mobile apps. It’s important to keep your audience and their devices in mind when creating maps and map elements. Large labels can quickly overrun a small screen on a phone or tablet. With so much functionality at your fingertips with Arcade, it’s sometimes tempting to do all the things. But since we are dealing with reduced screen real estate, you’ll want to keep your labels short and to the point. Use your symbology in conjunction with your labels to show more information in a small space. If you have lots of information to share in your maps, consider using pop-ups to supplement your labels.  

Pop-ups

Pop-ups are a great place to take advantage of Arcade’s functionality, either by using Arcade exclusively or in conjunction with other content such as text boxes, charts, images, or field lists. Here is an example of how you can use three Arcade expressions to add useful data-driven information to a pop-up. For the first expression (shown below), we measured the herbicide treatment area in square feet and rounded the result. In the second expression, we measured the distance from the centroid of the treatment area to the nearest trail. For the third expression, we calculated the name of the nearest trail to the treatment area. Then using a text box, all of this information was added to the pop-up in two short plain text sentences.  

Pop-up using Arcade elements in ArcGIS Online

Smart forms

You can use Arcade to create conditional logic and calculations to make your forms more streamlined and user-friendly for those collecting data in the field. Examples include calculating a total dollar amount from a damage assessment or using conditional visibility to only collect the data that’s needed. As of the February 2023 release, you can also set logic for conditional editing and conditional required. With conditional editing, you can set fields to be editable or read only. And conditional required allows you to set fields to be required, only when certain conditions are met. 

Up until this point, we’ve been focusing on how to set up map elements for use in Field Maps. We saw some pop-up examples and how to use Arcade to help streamline your data collection in the field. But what does it all look like when you are out in the field and viewing it on your mobile device? Looking at our trails and invasive species example again, here is what you can expect from a mobile view: 

Pop-up with Arcade Elements on mobile device

As you’ve seen, Arcade can be used to create powerful, dynamic, impactful maps that guide mobile workers, giving them additional context or simplifying and automating complex workflows. Using Arcade in ArcGIS Field Maps can be broken down into two broad categories – maps and smart forms. Now that we’ve seen symbology and label examples, here are a few additional examples of how Arcade can be used to improve maps for mobile workers: 

 

Arcade in the map 

Labels

The text functions in Arcade provide a wide variety of options for formatting, concatenating, searching, extracting, and replacing text strings. They can be incredibly useful for creating labels or displaying values exactly how you want them to appear in fields and text boxes. 

 

Text() is a function that allows you to easily format numbers and dates and return them as a text string – for example, if you have a datetime object: 

You can return just the date using: 

Or the day of the week: 

These functions will return ‘Mon’ or ‘Monday’, respectively. 

Again, even if you don’t own the data, you can use these powerful functions to manipulate values to show exactly what you need your mobile audience to see. 

 Pop-ups

 When working with pop-ups, you have even more options. FeatureSet() functions give you access to the attributes and geometry of layers in your map and in your organization. You can then take the geometry of one feature (the one being selected to view the popup, called using the $feature global) and any features in your layer of interest to perform a variety of spatial functions. For example, taking the trail layer from the previous example, we can count the number of observed poison ivy areas that intersect the trail:

When working with FeatureSets and spatial expressions, keep in mind the type of geometry you are working with. In this example, if the trail layer is a polyline, you’ll need to buffer it first to get an accurate count of the poison ivy patches that intersect the trail. 

Arcade in Forms 

Using Arcade in pop-ups, labels, or symbology gives you a large amount of control over what your mobile workers see in their maps. Arcade makes those features dynamic, and they will change as the data changes. Using Arcade in Forms is a bit different. The functions and syntax are the same, but you are using Arcade expressions to capture data rather than to display it.

 

In the previous example, we counted the number of poison ivy patches that intersected a specific trail. If we want to capture that information when a trail is inspected, we can use Arcade for the calculated expression in the form builder. The Arcade expression we’ll create to do this is very similar to the previous example. In the example below, we have a polyline for the trail, a related table with trail inspections, and we want to automatically capture the number of poison ivy points that are within 50 feet of the trail centerline when doing an inspection. Building on the previous example, this is what that Arcade expression would look like: 

When the value is returned in the final line, it is not used for display, but instead is inserted in the field used to store the poison ivy sightings in each inspection record. Calculated values increase productivity and decrease data-entry errors. The calculations happen automatically without the mobile worker needing to do anything other than collect or edit a feature, and they can be used with related tables as well as with points, lines, or polygons. 

Now that we’ve gone over some examples of how you can use Arcade with Field Maps, here are some tips and tricks to help you successfully write your own Arcade expressions:  

Here are additional resources you can check out to start learning more about Arcade:  

If you liked this blog or if you just skimmed it and would much rather watch a video, you can see our presentation on this very subject here: ArcGIS Field Maps: Getting Started with Arcade. For more on Arcade with Field Maps check out this video by Sarah Saint-Ruth: Arcade and ArcGIS Field Maps

About the authors

Kerri Rasmussen is a Product Engineer on the Field Apps team at Esri, working on Field Maps and Navigator. Kerri has a GIS background in Emergency Management and Utilities which help guide her work at Esri. She is excited to be part of the team that puts the power of GIS into the palm of your hands.

Connect:

Chris Dunn is a Sr Product Engineer on the Field Maps team. He works closely with Product Managers, other Product Engineers, Designers, and Developers to ensure Field Maps continues to be a high quality mobile GIS application. He loves seeing the amazing ways users solve problems using Esri technology and he wishes Arcade existed back when he worked as an analyst using ArcMap 9.3.

Connect:
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments

Next Article

Brevard County Fire Rescue plans ahead with the Pre-Incident Planning solution

Read this article