PROBLEM
In ArcGIS Pro, attempts to run the Calculate Field tool when using Python expressions with the date field as the first parameter and the text field as the second parameter fail. The following error message is returned:
Error: ERROR 000539: File "", line 1 method(GPVARIANTOBJECT0, attribute1 ) ^ SyntaxError: invalid syntax
This is a known limitation, when the order of date followed by text fields combination is used as parameters in the Python expressions in ArcGIS Pro.
Use one of the methods below to resolve the issue.
Use the text field as the first parameter
In ArcGIS Pro, reverse the order of the parameters in the Python expressions. In this example, the text field, Errors, is used as the first parameter, and the date field, SurveyDate, is used as the second parameter.
Use Arcade expression
Refer to ArcGIS Arcade: Getting Started for more information. In this example, the Arcade function is used to return the required statement in the Status field, depending on the attribute values in the SurveyDate field.
The following image demonstrates the Calculate Field tool has run successfully, and the desired result is returned in the Status field.
Article ID: 000026884
Get help from ArcGIS experts
Download the Esri Support App