tut Pro Arcade Pop-Ups

Custom Pop-Ups and the use of Arcade Expressions

(return to the ArcGIS PRO / Cartography Tutorials page)

See also Arcade for Custom Labels

See also:

 

Pop-Ups can include a simple list of field values as well as Charts, Images and Text elements. Pop-Ups can also be customized using Arcade Expressions.

(Arcade is an Expression language developed by ESRI for use with ArcGIS Pro, ArcGIS Online and spatial data sets. Arcade includes a collection of 'functions' that can be used to modify values, including values from attribute fields. In addition to symbology, labels, etc. Arcade can be used for customizing Pop-Ups.)

 

To display a pop-up in ArcGIS Pro, click on a feature using the Explore tool (from the Map tab of the ribbon).

By default, ArcGIS Pro (or ArcGIS Online) will display a generic list of all of the fields from the attribute table for the pop-up.

Pop-Up with All Fields

This basic list of fields can be customized by configuring the pop-ups.

In ArcGIS Pro, right-click on a layer in the Contents to open the Configure Pop-Ups pane:

Pop-Ups - Configure pane

By opening the Fields element (from the Configure Pop-Ups pane) you can specify which fields to be included or excluded from the list:

Pop-Up Configure Fields

Close the Fields element by using the back arrow to return to the Configure Pop-Ups pane. Use the Explore tool to view the results in a new pop-up.

Below is the resulting pop-up, displaying only certain fields:

Pop-Up with limited fields

 

Remove the Fields List Element

You can also remove the Fields list entirely from the pop-up by clicking the X (remove pop-up element) in the fields element in the Configure Pop-Ups pane:

Pop-Up Remove Fields element

 

Add a Text Element

Click the Text icon (in the Configure Pop-Ups pane) to add a Text element.

Open the Text element to configure it's content.

Within the Text element you can use the Field drop-down list to insert a value from an attribute field). Field variables are indicated by the use of curly brackets { } in the text element.

Pop-Up Text element

Close the Text element by using the back arrow to return to the Configure Pop-Ups pane. Use the Explore tool to view the results in a new pop-up.

Text elements can include carriage returns, multiple fields, custom formatting (bold, italics, etc.). and URL links...

Pop-Up with Multiple Lines and Fields

 

Creating and Adding an Expression

Text elements can also make use of expressions. Pop-up expressions can be created using Arcade, Vbscript, Python, etc. (the examples below use Arcade). Pop-Up expressions are similar to label expressions and can be used to format text and numbers (adding commas, rounding numbers, specifying the number of decimal places, etc.) as well as mathematical operations, etc.

To begin a new expression, click the Expression button at the bottom of the Configure Pop-Ups pane to open the Expression window.

In the Expression window, click New to open the Expression Builder

Below is an example of the Expression Builder using the text function to reformat a population number:

Pop-Up Expression Builder

Click OK to save the expression. By default, the first expression is named expression0. You can rename your expression in the Name field if you wish. Renaming your expressions will make it easier to identify them later.

Return to the Text element to include an expression. Expressions will be listed at the bottom of the Fields list and like a Field value will be shown in curly brackets within the text element):

Pop-Up Text with Expression

 

Mathematical Expressions

Expressions can also be used to perform mathematical operations on numbers.

Below is an example of an expression to calculate the difference in population between 2007 and 2000 and then reformat the output value as a text string:

Pop-Up Mathematical Expression Reformatted

And below is the Text element using the above expression for the custom pop-up - in this example there are 3 expressions, one to reformat the 2000 population number, a second to reformat the 2007 population number and a third to display the difference between 2007 and 2000 population, again reformatted:

Pop-Up Text with Expressions

 

 

 

See also: