HOW TO

Change multiple values in a field of a pop-up using Arcade in ArcGIS Online

Last Published: August 18, 2023

Summary

Custom expressions written in Arcade can be used to configure pop-ups in ArcGIS Online. These expressions can be used to generate new data with reference to a field with multiple values in a layer's existing fields.

This article provides the steps to change numerous values in a field of a pop-up via ArcGIS Online Map Viewer. In this example, a new field (Species General Name) is added to the pop-up using the SPECIES_CODE field as reference to display the full name of numerous fish species for each point symbol.

Procedure

  1. Open the map in Map Viewer. Click Layers on the Contents (dark) toolbar, and select the <layer name> with the pop-up for editing.
The Map Viewer Contents (dark) toolbar with the Layers tab
  1. Click Configure pop-ups on the Settings (light) toolbar > Manage expressions.
The Map Viewer Pop-ups pane used to navigate to the Map Viewer Pop-up expressions pane
  1. Click + Add expression to open the Arcade expression editor window.
The Map Viewer Pop-up expressions pane with the Add expression icon
  1. Specify the following Arcade expression in the Expression window.
var <variableName1> = Dictionary('<field1>', '<value1>', '<field2>', '<value2>',...);
var <variableName2> = 0;
var <variableName3> = [];

if (Count(Split($feature.<fieldName>, ', ')) > 0) {
    for (var i in Split($feature.<fieldName>, ", ")) {
        <variableName3>[<variableName2>] = <variableName1>[Split($feature.<fieldName>, ', ')[i]];
        <variableName2>++;
    }
}

return Concatenate(<variableName3>, ', ');
  1. Rename the New expression, and click Done.
Specifying the Arcade expression in the Map Viewer Expression window
  1. Click Previous, found above the newly created Arcade expression in the Pop-up expressions pane.
The Map Viewer Pop-up expressions pane with the newly added expression
  1. Click Fields list to expand the list of fields displayed in the pop-ups and click Select fields.
The Map Viewer Pop-up expressions pane displaying the location of the Fields list section
  1. Check the expression field and click Done.
The Map Viewer Select fields pane to select fields to be displayed in the pop-up

The pop-up display without the Arcade expression.

An example of the Map Viewer pop-up without the Arcade expression

The pop-up display after applying the Arcade expression.

An example of the Map Viewer pop-up with the Arcade expression enabled

Article ID: 000027206

Software:
  • ArcGIS Online

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options