HOW TO

Add a prefix to values in a field in ArcGIS Pro

Last Published: April 27, 2023

Summary

In ArcGIS Pro, a prefix can be added to values in a field. For example, a state prefix can be added to a field containing the names of cities in the attribute table, as shown in the image below. This article provides the workflows.

A City field with city name values in an attribute table.

Procedure

Add a user-defined prefix using the Calculate Field tool in the attribute table

Note:
This option is only applicable when adding prefixes to a text field type.
  1. Open the project in ArcGIS Pro.
  2. In the Contents pane, right-click the layer and click Attribute Table.
  3. In the attribute table, right-click the field and click Calculate Field.
Navigating to the Calculate Field tool in the attribute table
  1. In the Calculate Field window, depending on the Expression Type, enter the following expression in the expression box:
  • For Python 3
"<the prefix>" + " " + !<field name>!
  • For Arcade
"<the prefix>" + " " + $feature.<field name>
Note:
Omit " " in the expression to remove the space separator between the prefix and the field values.
Configuring the Calculate Field tool with the expression
  1. Click Apply and click OK. The prefix is added to the values in the field as defined by the expression.

The image below shows the ‘SC’ (South California) state prefix added to the City field values.

The SC state prefix is added to the City field values in the attribute table

Add a prefix using an existing field from the attribute table

If the attribute table has an existing field to be used for the prefix, concatenate the two fields with a space separator. Refer to ArcGIS Pro: Code samples–strings for more information.

Article ID: 000030124

Software:
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 0
  • 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

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options