Summary
In ArcGIS Pro, some features in the attribute table are written in uppercase, lowercase, or mixed case. Sometimes, it is necessary to standardize the casing of the features to ensure data consistency.
In this article, strings are converted to proper case strings using the Python and Arcade expressions in ArcGIS Pro.
Procedure
- Open the ArcGIS Pro project.
- Add a new field to the feature class in ArcGIS Pro.
- In the Contents pane, right-click the layer and click Attribute Table.
- In the attribute table, click Add Field .
- In the Fields view, specify a name for the field in the Field Name column.
- Double-click the Alias column and specify an alias for it.
- Double-click the Data Type column and select Text from the drop-down.
- On the top ribbon, on the Fields tab, click Save.
- In the table view, right-click the field's header and select Calculate Field.
- In the Calculate Field window, select the field from the Field Name (Existing or New) drop-down. In this example, City Proper Case is selected.
- Select Python 3 or Arcade from the Expression Type drop-down.
- For Python 3, in the <Field_Name> box, type the following expression and click Verify.
!fieldname!.title()
- For Arcade, in the <Field_Name> box, type the following expression and click Verify.
Proper($feature.fieldname)
- When the message, "Expression is valid" is returned, click OK.
The following image shows the string converted to proper case.