PROBLEM

A warning message is returned when attempting to concatenate fields using a Python expression in the Calculate Field tool

Last Published: March 11, 2022

Description

In ArcGIS Pro, the Calculate Field tool allows concatenating fields, to merge or summarize multiple attributes into one field. In some cases, concatenating fields using a Python expression in the Calculate Field tool fails, and returns one of the following warning messages:

Warning:
002858: Certain rows set to NULL due to error while evaluating python expression: TypeError: unsupported operand type(s) for +: ‘<FieldType>’ and 'NoneType'
An example of a warning message returned when attempting to concatenate fields using Calculate Field tool in ArcGIS Pro.
Warning:
002858: Certain rows set to NULL due to error while evaluating python expression: TypeError: can only concatenate <FieldType> (not "NoneType") to <FieldType>
Another example of a warning message returned when attempting to concatenate fields using the Calculate Field tool in ArcGIS Pro.

Cause

The issue occurs when there are Null values in the selected fields.

Solution or Workaround

In ArcGIS Pro, depending on the field data type, replace the Null values with zeros or blank values before using the Calculate Field tool.

If the field values are numeric, replace the field's Null values with zeroes in the attribute table.

If the field values are strings, use the following expression in the Calculate Field tool to replace field's Null values with blank values in the attribute table:

!<FieldName>!.replace("<Null>", "")

In this example, the Python expression is constructed using the Fields and Helpers lists in the Calculate Field tool.

Construct the Python expression using the Fields and Helpers list in the Calculate Field tool.

The image below shows the Null values are replaced by blank values in the Field3 field after the Python expression is used in the Calculate Field tool.

The Null values are replaced by blank values in the Field3 field in the attribute table.

Article ID: 000027241

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

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options