Getting error "An item with the same key has already been added. Key: NApplicationCard_1"

This is happening mainly when i try to right click and run from the Browser application Activity (While not observing when i run the main flow fully)

The work flow, Open Browser application(Google), “Type Into” action after opening browser.

Not able to understand why this happening

Hi @Leela_Hari_Gopal ,

Could you maybe try closing the Studio and opening the workflow again and Check whether it is having the same issue ?

Also, Could you provide the list of Dependencies along with it’s versions used ?

Even after restarting this behavior is happening. Dependency info below

Hi @Leela_Hari_Gopal
In this case restart UiPath studio or your machine. If doesn’t help means instead debug mode use run mode to test the process.

Regards,
Kaviyarasu N

I got the same Problem when I try to run it in debug mode.

Hello, guys!
I believe the problem is related and can be somewhat solved as in this thread:

I did this for the same error on my Main.xaml workflow and it worked.

However, the same error happened again in the already converted process on another workflow - empty workflow and built completely new (copy-paste from another workflow though).

Now I wonder if the conversion function works at all and maybe I will refrain from converting projects.
I don’t want to have to do this correction manually for each such error…

Hi there,

We ran into the same issue and it seems to generally occur with the new project type.

Repro is simple:

  • Create a blank process with Windows as project type
  • Add a Use Application/Browser Activity, point it to chrome or something like that
  • Add any Activity inside the scope
  • Run the workflow from that “User Application/Browser” Activity (in our case we used Test Activity)

If it’s run from a parent sequence, everything is fine and does it’s job.

Can supply a sample project, studio version is 22.10.4

Would be cool if that could be fixed, but as a workaround → encapsulate the activity in another sequence.

Thanks and BR
Markus

I can help explain this as so far there isn’t a clear reason or solution.

So each activity in a xaml workflow has an ‘id’. This id must be unique.
Certain circumstances cause the same id to be used in different activities, this results in the error you see when you try to run or invoke the workflow, presumably because all the activity ID’s are being added to a dictionary so you get the key error.

I personally regularly see this using mocked workflows when I mock more than one activity.
The consistent fix I see for mocks is to mock and another activity, then remove the mock I just added. This ‘resets’ all the ids and they are correctly unique again.

I expect the same in this scenario, add a log message, then remove it. I believe it will ‘reset’ the id’s.
If not you can look directly in the xaml itself and see if you find the duplicated ID.

This is a weird bug, I have only ever seen it in mocked workflows under the scenario given so I feel its quite niche, interesting to see it happen in ‘normal’ workflows.

Hi,

Were you able to find a solution? I am taking the same udemy course but could not find solution.

1 Like

Can you explain it more your solution? I understand what you said but I’m unable to understand the steps I have to do

If adding a log message to force a reset of the ID’s doesnt work, you need to go into the XAML directly by opening it in Notepad or Notepad++, search for all the IDs and find the ones that have the same value, change one of them to be unique.

I just had the same problem.
What worked for me was:
ctrl+x everything (so the most outer sequence/flowchart)
past it again in the same place.

This resets all the ids again so you don’t have any double anymore.