Summary
In ArcGIS Pro, the Field Calculator tool can merge two or more text fields to create a new field with the merged field attributes. This may be done to improve readability of the field values, or for data uniformity, if two or more fields must be combined.
The instructions provided describe how to use the Field Calculator in ArcGIS Pro to merge the string and ObjectID fields in the attribute table. The OBJECTID and NAME fields in the attribute table are merged in this example.
Procedure
- Start ArcGIS Pro and open the project.
- In the Contents pane, right-click the feature layer, and click Attribute Table to open the feature layer attribute table.
- In the feature layer attribute table pane, click Calculate to open the Calculate Field dialog box.
- In the Calculate Field dialog box, configure the following parameters:
- For Input Table, select the feature layer.
- For Field Name (Existing or New), select the available field to update the existing field for the merged fields. Alternatively, create a new merged field name.
- If a new field is created, for Field Type, select the preferred field type. Refer to ArcGIS Pro: ArcGIS field data types for more information.
- For Expression Type, select Python 3.
- For the Expression section, merge the string and the OBJECTID field in the attribute table using the following expression:
!<FieldName>! + " - " + str(!OBJECTID!)
Note:
Refer to ArcGIS Pro: Calculate Field Python examples for further information on Python expressions.
- Click OK.