HOW TO

Assign colored symbols to attributes using Arcade expressions in ArcGIS Pro

Last Published: January 12, 2022

Summary

In ArcGIS Pro, assigning various colored symbols to one or more attribute fields in a dataset provides better visualization of spatial data on a map. When there is irrelevant data within the same fields, Arcade expressions and the Symbology tool can be used to further categorize a collection of attribute fields to offer a more focused display of symbology points.

The instructions below describe how to use the Field Calculator in ArcGIS Pro to identify a specific set of attribute fields to be displayed on a map. In this example, the LEVEL field in the Schools_all feature class is used to identify the attribute field symbology points for elementary, high school, and college or university.

Procedure

Use either one of the workflows below to assign colored symbols to attributes using Arcade expressions.

Note:
To retain the values of the attribute, use the solution without creating a new field. If the values of the attribute can be combined, use the solution of creating a new field.

Assign colored symbols to attributes without creating a new field

  1. Start ArcGIS Pro and open the project.
  2. In the Contents pane, right-click the feature class, and click Symbology to open the Symbology pane.
How to open the Symbology pane of a feature class in the Contents pane
  1. In the Symbology pane, click the Primary symbology drop-down menu, and click Unique Values.
Changing the Primary symbology option from Single Symbol to Unique Values in the Symbology pane
  1. Click the Field 1 drop-down menu, and click the <field name> to be configured.
Selecting the LEVEL field for the Field 1 option in the Symbology pane
  1. Click the Set an expression button, to open the Expression Builder dialog box.
The location of the Set an expression icon in the Symbology pane
  1. Specify the following Arcade expression in the Expression Builder dialog box, and click OK.
var <variable name> = $feature.<field name>
if (<variable name> == "<field value>") {
    return "<label name>";
} else if (<variable name> == "<field value>") {
    return "<label name>";
} else if (<variable name> == "<field value>") {
    return "<label name>";
} else if (<variable name> == "<field value>") {
    return "<label name>";
}
An example of the Arcade expression included in the Expression Builder dialog box
  1. Click the More drop-down menu, and uncheck Show all other values.
Uncheck Show all other values from the More drop-down menu in the Symbology pane
  1. Choose a color scheme by clicking the Color scheme drop-down menu.
Choosing a color scheme for the symbols in the Symbology pane

Assign colored symbols to attributes by creating a new field

  1. Start ArcGIS Pro and open the project.
  2. In the Contents pane, right-click the feature class, and click Attribute Table to open the table view.
How to open the Attribute Table of a feature class in the Contents pane
  1. In the table view, click Calculate to open the Calculate Field dialog box.
The location of the Calculate icon in the feature class attribute table pane
  1. In the Calculate Field dialog box, configure the following parameters.
    1. For Input Table, select the feature class. Schools_all is used in this example.
    2. For Field Name (Existing or New), enter a new field name. 'EDU_GROUP' is used in this example.
    3. If a new field is created, for Field Type, select Text. Refer to ArcGIS Pro: ArcGIS field data types for more information.
    4. For Expression Type, select Arcade.
    5. For the Expression section, input the Arcade expression below to define a group of colored symbols for the new attributes.
    6. Click OK.
var <variable name> = $feature.<field name>
if (<variable name> == "<field value>") {
    return "<label name>";
} else if (<variable name> == "<field value>") {
    return "<label name>";
} else if (<variable name> == "<field value>") {
    return "<label name>";
} else if (<variable name> == "<field value>") {
    return "<label name>";
}
The Calculate Field dialog box with the parameters filled
  1. In the Contents pane, right-click the feature class, and click Symbology to open the Symbology pane.
How to open the Symbology pane of a feature class in the Contents pane
  1. In the Symbology pane, click the Primary symbology drop-down menu, and click Unique Values.
Changing the Primary symbology option from Single Symbol to Unique Values in the Symbology pane
  1. Click the Field 1 drop-down menu, and click the newly created field in Step 4(b).
Selecting the newly created field for the Field 1 option in the Symbology pane
  1. Right-click the <Null> value label, and click Remove.
How to remove the <Null> value label in the Symbology pane
  1. Click the More drop-down menu, and uncheck Show all other values.
Unchecking Show all other values in the More drop-down menu in the Symbology pane
  1. Choose a color scheme by clicking the Color scheme drop-down menu.
Choosing a color scheme for the symbols in the Symbology pane

Article ID: 000026934

Software:
  • ArcGIS Pro 2 8 x
  • ArcGIS Pro 2 7 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