PROBLEM
The Field Calculator is a great tool that can be used to modify field values all at once without taking the time for individual calculations. However, using the Field Calculator requires careful awareness of details such as field type, field length, and domains. In some situations, a user may see that the Field Calculator ran with no errors, but the field values have not changed.
The caveat to using Field Calculator is that the user must be aware of the types of fields being consumed.
If, for example, a user has a table with two columns and wants to fill out a third with text only if the first two match:
Using comparison code in Field Calculator:
This completes and appears to have succeeded in the Geoprocessing menu > Results, but the third column does not change.
This is because the two input fields, though in some cases may appear the same (1 in FieldName1 and 1 in FieldName 2), they are different field types:
Therefore, the string "1" is not equal to the short integer "1", and because there is no "else" statement to go with the "if" statement in the code block, nothing is returned to populate the field.
Get help from ArcGIS experts
Download the Esri Support App