I am getting an error saying “Item With Same Key Has Already Been Added” even though I initialized the dictionary to a new empty dictionary. This was working just fine yesterday, I added some more work to the sequences, and now it is no longer working correctly. Please help, thanks.
Please upload the workflow
The workflow is somewhat large and contains secure information dealing with my company. I’m just confused as to why it would work one day and not the next.
You probably wrongly changed the scope of the dictionary.
Check in the new sequence Added, Whether u r adding the Duplicate Key to the Dictionary.
Regards,
Mahesh
Same case. Any update ?
Hi,
I don’t know what is your error situation. But I’m getting same error when I use ‘Write Range’ Excel workbook activity. I change it. I use ‘Write Range’ activity in Excel Application Scope. And my problem solved.
Thanks.
This is the way to make it, but not the best. Any ideas about the reason of an error?
Hi Community, even I had faced the same issue that,
"Add to dictionary: An item with the same key has already been added."
Reason: while we are adding Key into dictionary from data table. it will also add the empty rows into dictionary. so that next time is there empty row in the data table it will throw the above exception.(same key already exist or added).
Solution: Before adding key value pair into dictionary, please check the empty rows from datarow and avoid to add into Dictionary.
I had a similar issue with a switch activity. There was no dictionary involved, but I was still getting the same error.
Fix:
I commented the switch activity, clicked on Analyze File > Validate File. The error disappeared, which confirmed that it was the switch activity that was causing the error.
I then re-enabled the activity and clicked on validate file again and error was gone.