Select to view content in your preferred language

Error uploading Excel file to AGOL: 'Item with the same key has already been added'

4601
5
Jump to solution
02-27-2020 10:52 AM
Trippetoe
Frequent Contributor

I am trying to upload an Excel file to AGOL, but i keep getting an error with the message: "Item with the same key has already been added'.  I am using the 'Add Item -> From your Computer' tool on the Content tab.  As far as i can tell, the Excel file i want to upload has never been added to my AGOL org.

Using Chrome's Dev tool,  i see the following network communications, which seem to indicate that the file upload works but the itemId already exists. Is that possible?

sharing/rest/search
{"query":"title:\"AsthmaRelatedHospitalizationRates\" AND type:\"Microsoft Excel\" AND owner:\"..........\" AND ownerfolder:\".............\"","total":0,"start":1,"num":1,"nextStart":-1,"results":[]}

sharing/rest/content/users/..../..../addItem
{"success":true,"id":"46b220edf0854c858e797c7632cb3176","folder":"2e2438a634d44787802372535a19727a"}

sharing/rest/content/users/..../..../status
{"status":"completed","statusMessage":"completed","itemId":"46b220edf0854c858e797c7632cb3176"}

sharing/rest/content/features/analyze
{"error":{"code":400,"message":"An item with the same key has already been added.","requestId":""}}

Any thoughts on how i can get the file uploaded? 

Thank you.

1 Solution

Accepted Solutions
Trippetoe
Frequent Contributor

I contacted Esri tech support about this issues, and the fine person there helped me figure out the problem. One of the sheets in the Excel file had some duplicate 'column header' values. Once we eliminated the duplicate columns, i was able to upload the file without a problem.

View solution in original post

5 Replies
Trippetoe
Frequent Contributor

I contacted Esri tech support about this issues, and the fine person there helped me figure out the problem. One of the sheets in the Excel file had some duplicate 'column header' values. Once we eliminated the duplicate columns, i was able to upload the file without a problem.

JenniferBorlick
Frequent Contributor

Thanks. I just had this happen as well. Perhaps a more intuitive error message would be helpful. Like "Error: Column names cannot be duplicated."

BrittanyBurson
Frequent Contributor

Thank you Tom for sharing your resolution. I just had this error and the same fix worked for me.

0 Kudos
CarynNezatUSDA
Occasional Contributor

I am having the same error. I have multiple tabs in my excel file and there are no duplicate headers in the file, however the GlobalId is a duplicate header on the different sheets. Could this be the problem? I had some data in the FL but want to update and append. I even created a completely new FL and still have the same problem. ANY help or ideas would be appreciated 

0 Kudos
pslgisAdmin
Occasional Contributor

Just spent time with a wonderful ESRI Tech today. Eventually figured out there was a duplicate field in the add feature's attributes. I had been using an application for over 5 years that used add_feature on my local ArcGIS 10.7.1 ArcGIS Server. Tried to move to AGOL Hosted feature service and the exact same code would bomb with this VERY UNHELPFUL error. 

The problem was in my .Net Application that generates the add_feature URL,  the Comments field was spelled 2 different ways in different functions. One function referred to it as "COMMENTS" and the other function referred to it as "Comments". Apparently ArcServer 10.7.1 was smart enough to realize it was the same field and it worked. Or it was dumb enough to not care! I don't know.

wish I would've read this thread better though

0 Kudos