HOW TO
Pop-ups in ArcGIS Online can be configured using custom expressions written in the Arcade expression language. Expressions can be used to generate new data with reference to an existing field in a layer that has different values.
This article provides the steps to round the values of a field to the nearest thousand for numbers above 100,000, and the nearest million for numbers above 1,000,000 in ArcGIS Online Map Viewer. In this example, the value of the TOTPOP_CY field is referenced to round the numeric value for each symbol.
var <variableName> = $feature.<fieldName> if (<variableName> >= 1000000) { return (Text(Round(<variableName> / 1000000 , 2) * 1000000) / 1000000 + " M") } else if (<variableName> >= 100000 && <variableName> < 1000000) { return (Text(Round(<variableName> / 100000 , 2) * 100000) / 1000 + " K") } else { return Text(Round(<variableName> , 2)) }
The pop-up display without the Arcade expression.
The pop-up display after applying the Arcade expression.
Get help from ArcGIS experts
Download the Esri Support App