I have a Feature Class dataset that contains over 7,000 records with approximately 20 Data Fields. I need to update this Feature Class dataset with a spreadsheet containing updated information on approximately 1,700 of these records. The spreadsheet only contains 6 of the Data Fields found in the Feature Class dataset which includes a Global ID number.
I'm trying to update the records that share the same Global ID number and only for the 6 Data Fields found on my spreadsheet.
I've tried to use the Append geoprocessing tool, but am getting an error stating that my schema doesn't match my target value. I manually added the remaining Data Fields and made sure that the names all matched and applied the Append tool again, but still getting the same error.
Any help would be greatly appreciated!
Pete
Solved! Go to Solution.
In case anyone else runs into this issue, I wanted to post the solution to solve it (and thanks to Pete for making a concise list of steps). We created a solution by using a join instead of append.
The reason the append did not work is because the FID field in the CSV and the OBJECTID field in the Feature Class did not match as far as field type. The Append (Data Management) tool did work once we corrected the field types and saved as CSV. However with an Append is adds records to the end of the Feature Class (https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/append.htm) not updating the fields. Hence why we used a join for the solution.
I recommend added a UNIQUEID field to the feature class is because the OBJECTID field can be reordered by the software and so it is not reliable as an ID field. I have had issues when I name a field FID in the past, but I never have an issue when I create a new field called UNIQUEID. This will ensure you always have the UNIQUEID field.
With the spreadsheet you want to format all the headers to make sure they do not have an underscores or spaces – that can prevent you from performing the join. You then must save the spreadsheet as a CSV file and then click and drag that CSV file from Windows File Explorer to the ArcGIS Pro project.
You can use Python and UpdateCursor function to create a script to do this process in a more automated way.
Hi Pete!
Not sure without the data in front of me but it might be that sounds like is is a mismatched field type that is not allowing you to append. So for example if the field in the feature class is text but in your spreadsheet that field is set to numeric, that might be causing the error.
From the Append tool help:
If Input schema must match target schema is chosen for the Schema Type parameter, the schema (field definitions) of the input datasets must match that of the target dataset for the features to be appended. If Use the Field Map to reconcile schema differences is chosen for Schema Type, the input dataset schema (field definitions) do not need to match the target dataset. However, any fields from the input datasets that do not match the fields of the target dataset will not be mapped to the target dataset unless the mapping is explicitly set in the Field Map parameter.
You probably want to look at field mapping to make sure your field schema matches: https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/field-map.htm
In case anyone else runs into this issue, I wanted to post the solution to solve it (and thanks to Pete for making a concise list of steps). We created a solution by using a join instead of append.
The reason the append did not work is because the FID field in the CSV and the OBJECTID field in the Feature Class did not match as far as field type. The Append (Data Management) tool did work once we corrected the field types and saved as CSV. However with an Append is adds records to the end of the Feature Class (https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/append.htm) not updating the fields. Hence why we used a join for the solution.
I recommend added a UNIQUEID field to the feature class is because the OBJECTID field can be reordered by the software and so it is not reliable as an ID field. I have had issues when I name a field FID in the past, but I never have an issue when I create a new field called UNIQUEID. This will ensure you always have the UNIQUEID field.
With the spreadsheet you want to format all the headers to make sure they do not have an underscores or spaces – that can prevent you from performing the join. You then must save the spreadsheet as a CSV file and then click and drag that CSV file from Windows File Explorer to the ArcGIS Pro project.
You can use Python and UpdateCursor function to create a script to do this process in a more automated way.
Hi Pete,
I have successfully updated an AGOL hosted feature layer (HFL) directly from an XLSX from ArcGIS Pro 2.5.3 using a manual point-n-click approach. You can modify this to work with a FC instead of a spreadsheet.
Updates come in three types:
My general workflow for updates was:
But for now your FIDs should work.
If this was a regular update for 20 fields, ModelBuilder or Python with a stack of Calcuate Field calls should work.
If you're cautions, publish a copy of your Hosted Feature Layer to an AGOL dev group and test on that first.
Mic