I am trying to update a layer in Pro with a table the has updated information. I am trying to use the Append tool. When I run the tool, the field remain <Null>. Should I be using the Append tool or something different?
@DanPatterson
@DavidPike
@Robert_LeClair
@JohannesLindner
You can't append a csv file to a featureclass. You can use Join field
Join Field (Data Management)—ArcGIS Pro | Documentation
Dan and Johann are all correct in their responses. One thing that stood out to me in the common field between your two tables - it does not appear unique enough to me. For Joins in ArcGIS Pro, you have to consider cardinality, 1-1, M-1 and only in ArcGIS Pro 1-M. You can read more about it here.
I am trying to use the Append tool
The Append tool is not suited for this task. It takes all features from one table and copies them to the second table. That is not what you want to do here.
As @DanPatterson suggested, Join Field could work. You can't get it to work because you need to join on a common field. That is "Name" in your case, but you're trying to join on "Mgmt".
Another way to do this is with a little python script (untested):
# parameters input_table = "HOA_Boundaries_ExportFeature" update_table = HOA_Export_Test.csv" join_field = "Name" update_fields = ["Mgmt"] # read the update table into a dict fields = [join_field] + update_fields updates = {row[0]: row for row in arcpy.da.SearchCursor(update_table, fields)} # loop over the input table with an UpdateCursor with arcpy.da.UpdateCursor(input_table, fields) as cursor: for row in cursor: # copy the updated values try: cursor.updateRow(updates[row[0]) except KeyError: # no update found for this join_field, ignore pass
@DanPatterson Hi Dan - Thanks for you help with this. I ran the Join Field tool. It created a new field in my layer but the value is still <Null>. I've attached a screenshot. Do you see anything that I am doing wrong that it is always returning a <Null> value?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.