HOW TO

Use Arcade expressions and HTML tags to configure the text formatting for pop-ups in ArcGIS Pro

Last Published: August 2, 2022

Summary

In ArcGIS Pro, Arcade expressions and HTML tags can be used to format the text displayed in a pop-up according to the specifications applied. This article provides an example and instructions using the Arcade expressions and HTML tags to configure the text formatting for pop-ups in ArcGIS Pro.

Procedure

The workflow below utilizes the Arcade functions and HTML tags listed in the following table to configure the text formatting for pop-ups in ArcGIS Pro.

Arcade Function or HTML TagAttribute Result
Proper(inputText, applyToText)Transforms a text value to title case.
Left(value, charCount)Returns the specified number of characters from the start of a text value.
IIf(condition, trueValue, falseValue)Returns a given value if a conditional expression evaluates as true, and returns an alternate value if that condition evaluates as false.
Concatenate(inputText, value)Concatenates values and returns a text value.
if(fieldValue condition numberValue)
return "colorCodeNumber"
Assigns a color code number based on the criteria.
<font color='#{expression}' style=''>{fieldValue}</font>Applies color to the text.
<b>"text"</b>Bolds the text.
<em>"text"</em>Italicizes the text.
<u>"text"</u>Underlines the text.
  1. Start ArcGIS Pro and open the project.
  2. In the Contents pane, right-click the feature class and click Configure Pop-ups to open the Configure Pop-ups pane.
Opening the Configure Pop-ups tool of the feature class from the Contents pane
  1. Click Expressions, and click New.
  2. In the Expression Builder tool dialog box, configure the following parameters for each of the Arcade expression:
    1. For Name, rename the new expression.
    2. For Title, specify a title for the new expression.
    3. Specify the following Arcade expression in the Expression section:
  • The Arcade expression to capitalize the beginning of every word.
Proper($feature.<fieldName>, 'everyword')
  • The Arcade expression to replace a blank field value with 'Unknown'.
var t = Left($feature.<fieldName>, <characterNumber>)
var u = $feature.<fieldName>

IIf(t == " ", "Unknown", u)
  • The Arcade expression to assign colors based on three conditions.
if($feature.<fieldName> < <numericValue>){
    return "<colorCode>"
}
if($feature.<fieldName> >= <numericValue> && $feature.<fieldName> < <numericValue2>){
    return "<colorCode2>"
}
if($feature.<fieldName> >= <numericValue2> && $feature.<fieldName> <= <numericValue3>){
    return "<colorCode3>"
}
  • The Arcade expression to concatenate two texts when a condition is met.
var <variableName> = $feature.<fieldName>
var <variableName2> = Concatenate($feature.<fieldName2>, " <fieldValue>")
var <variableName3> = Concatenate($feature.<fieldName2>, " <fieldValue2>")

When(
ST == '<variableName2>', <variableName2>,
ST == '<variableName3>', <variableName3>)
  1. Click OK.
The Configure Pop-ups Expressions pane with the Arcade expressions and the Expression Builder dialog box with an example of the Arcade expression
  1. In the Configure Pop-ups pane, click the Back icon, and click Edit pop-up element.
The location of the Edit pop-element icon in the Configure Pop-ups pane
  1. Toggle the HTML mode option on to enter the HTML mode.
  2. In the Text Options pane, include the HTML tags as required.

The image below shows the configured pop-up whereby parts of the text are bold, italicized, and underlined.

The configured pop-up window and the Configure Pop-ups pane

Article ID: 000027941

Software:
  • ArcGIS Pro 3 0
  • ArcGIS Pro 2 8 x
  • ArcGIS Pro 2 x

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