HOW TO

Display greater or lesser numeric field values in a pop-up using Arcade in Map Viewer

Last Published: November 8, 2023

Summary

In ArcGIS Online and Portal for ArcGIS Map Viewer, it is possible to display numeric field values greater or lesser than a specific value using an Arcade expression. This is useful for better data management and analysis.

In this example, the Plantation feature layer contains three fields named Oats, Barley, and Wheat representing the types of crops in a state. To display the type of the crop in each state with greater than the value of '50000' in the pop-up, an Arcade expression is used.

The image below displays the table of the feature layer with the three fields and their numerical field values.

Table displaying the fields and the field values.png

Procedure

  1. Open the web map in Map Viewer.
  2. In the Layers pane, select the layer. In this example, a polygon layer named 'Plantation' is used.
  3. On the Settings (light) toolbar, click Pop-ups. Ensure pop-ups are enabled by toggling Enable pop-ups on.
  4. In the Pop-ups pane, create an Arcade expression to display the field names in the pop-ups. Refer to ArcGIS Online: Use expressions or Portal for ArcGIS: Use expressions for instructions.
  5. In the editor window, configure the expression below.
var <variable_name> = {}
function P(A, B)
{
  var C = A
  If(Round(C, 2)<symbol><value>)
  {
    pop_up[B] = C
  }
}

P($feature.<field_name1>, "<field_name1>")
P($feature.<field_name2>, "<field_name2>")
P($feature.<field_name3>, "<field_name3>")

return <variable_name>
  1. Replace <variable_name> with the desired variable name. In this example, 'pop_up' is used.
  2. Replace <symbol> with the greater or lesser than symbol. In this example, the greater than (>) symbol is used.
  3. Replace <value> with the specific value to be measured as greater or lesser than the fields to be displayed. In this example, the value 50000 is specified to display fields greater than 50000.
  4. Replace <field_name1>, <field_name2>, and <field_name3> with the names of the fields containing the numeric field values. In this example, the field names are Oats, Barley, and Wheat.
  1. Click Done.
Note:
Click OK in Portal for ArcGIS Map Viewer.
Configuration of the Arcade expression.png
  1. In the Pop-ups pane, click Fields list and click Select fields.
  2. In the Select fields pane, under Expressions, click the expression created in Step 5 to display in the pop-up.

The Map Viewer pop-up below displays the fields with values greater than 50000.

Pop-up displaying field values more than specified field values.png

Article ID: 000031374

Software:
  • ArcGIS Online
  • Portal for ArcGIS
  • ArcGIS Enterprise 11 0
  • ArcGIS Enterprise 11 1

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