PROBLEM

The attribute table and map are not updated while a Python script is running in a loop

Last Published: March 18, 2022

Description

When running a script with the arcpy.da.UpdateCursor() function in ArcGIS Pro, the map does not update while the script is running, and the attribute does not display the new data.

Cause

This is expected behavior. ArcGIS Pro updates the map after every update is completed within a loop. This is different from ArcMap where users can utilize the arcpy.RefreshActiveView() function to refresh the map for every update within an iteration.

The table does not refresh if the attribute table of the feature involved in the script is opened prior to running the script.

Solution or Workaround

Wait for the script to finish running to view the updated map. The process is now automatic in ArcGIS Pro, leading to the deprecation of the arcpy.RefreshActiveView() function. To view the updated attribute table, close and reopen the attribute table of the selected feature. Refer to ArcGIS Pro: Add and open a stand-alone or attribute table from a map or scene for instructions and more information.

Article ID: 000027383

Software:
  • ArcGIS Pro 2 8 x
  • ArcGIS Pro 2 7 x
  • ArcMap 10 7
  • ArcGIS Pro 2 x
  • ArcMap 10 8

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options