When attempting to upload a Microsoft Excel (.xlsx) file in ArcGIS Online, the action fails and returns the following error message:
An item with the same key has already been added.
The following are known causes for the issue:
- Two or more fields in the Excel file have the same name.
- The field name in the Excel file contains special characters or spaces.
Solution or Workaround
Depending on the cause, use one of the options below to resolve the issue.
Rename or remove the duplicate field
- In Microsoft Excel, browse to the fields with the same name, and rename one of them. In the example below, the duplicate field (SITE_ID) is renamed to SITE_ID_01.
- Remove the column if the field of the same name is a duplicate.
Ensure the field names do not include special characters or spaces
- Delete special characters such as slash (/) from the field names.
- Replace spaces in the field names with underscores.
Convert the Excel file to a CSV file
- Open the Excel file.
- Click File > Save As.
- In the drop-down menu, select the .csv file format, and click Save.