laptop and a wrench

Bug

Adding a new field and calculating the field within a Python script tool fails to find the newly added field.

Last Published: August 19, 2020 ArcGIS for Desktop
Bug ID Number NIM086112
SubmittedOctober 30, 2012
Last ModifiedJune 5, 2024
Applies toArcGIS for Desktop
Version found10.1
Operating SystemWindows OS
Operating System Version7
StatusWill Not Be Addressed

Additional Information

We apologize that we were unable to address this issue within the current product support cycle.  If the issue continues to affect your work in a supported release, please contact Technical Support.

Workaround

Use arcpy.GetParameterAsText() instead of arcpy.GetParameter. However, the recommended approach for this issue is to pass the results of tool execution into the next tool to ensure that it is updated correctly.import arcpyvTab = arcpy.GetParameter(0)# Add and calculate Percent Pop and Housing Fields.field1 = "Pop1"field2 = "Pop2"table_result = arcpy.AddField_management(vTab, field1, "DOUBLE", field_is_nullable="NULLABLE")table_result = arcpy.AddField_management(table_result, field2, "DOUBLE", field_is_nullable="NULLABLE")val = 12345val2 = 54321arcpy.CalculateField_management(table_result, field1, val)arcpy.CalculateField_management(table_result, field2, val2)arcpy.AddMessage("End of Script")

Steps to Reproduce

Bug ID: NIM086112

Software:

  • ArcGIS for Desktop

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options