The given key was not present in the dictionary

Hi All,

I’m encountering an error and can’t find the solution, i’ve searched the forum but nothing turned up.

Error:

10:19:01.4072 Error {“message”:“Set transaction status : The given key was not present in the dictionary.”,“level”:“Error”,“timeStamp”:“2017-12-12T10:19:01.4072202+01:00”,“windowsIdentity”:“MUTWORLD\F501RPA01”,“processName”:“POT_AS400_Productie”,“processVersion”:“1.0.6549.29376”,“fileName”:“Main”,“jobId”:“feedd65f-25d2-4934-9c95-bac54958a327”,“robotName”:“S501WP1RPARDS01 01”}Untitled

1 Like

Hi @matthias.sevenant,

Could you please upload the workflow for more info?

Please let me know what you are trying to perform?

Thanks
Girish

Hi @matthias.sevenant,

This error occurs when trying to access a dictionary using a key that does not exist.

A dictionary is a special form of array arranged by Keys and Values. Every key must be unique and you then use that key to access it’s corresponding value.

e.g. a dictionary may look like dictionary = {A:“Apple”,B:“Orange”,C:“Pear”} If you ask for the value dictonary(A) you will get the value Apple.

if you have a process that doesn’t Always have the required key you can use the Key Exists activity to check before you try and access it.

Or use a try catch to catch the key does not exist exception and handle the error that way.

Thanks

4 Likes

I have the same problem in my statemachine while updating the transaction item

4 Likes

In my case this error occured, when I’ve tried to set transaction status two times for the same transaction, e.g. set “Success”, do some things and then again set “Success”.
You should probably check, if the Robot is not processing the same transaction two times or maybe You double setting status somewhere.

@qateam

I also encountered the same in the past having Two different transactions started concurrently (two different queues), the second “Set” then failed.

Here are screenshot where it is reproduced.

image

image

Cheers

trans2

@Florent_Salendres , I think that transactions just can’t be nested. The same is when You use “Add queue item”. If You set up them in order like on my screenshot it works.

1 Like

Hello @matthias.sevenant You get the solution for this.

Hi,

It can mean a great number of things. But to define the error message, the queueitem/transactionitem you are processing is read and the data is stored in a dictionary.

So this message says that the key is not found in the queue item value. So make sure you check the keys you are getting from you transaction item is correct (case sensitive).

Another reason could be that you try setting the transaction status twice for the same item.

In my opinion, there is clearly no explanation here which parameters were not found. Everyone who learns to program nowadays also knows that meaningful “speaking” error messages are very valuable. So, the called function is looking for a parameter - note: the name was passed on - and cannot find it. So the error message should also be able to reflect the name of the parameter and not just a “not found”. Why doesn’t she do that? This is one of the things that I have found fault with UiPath functionality for years.

2 Likes

to make it very clear what I mean, I provoked an example.
A key is not found in a config file here.


The red box shows the place where this exception occurred. And the yellow box shows exactly that the information you need later is available.

Here enlarged again and clicked on the magnifying glass in the 2nd line
Now I would have expected that at least the name of the activating activity would be passed on. But that’s exactly what doesn’t happen!

The whole action above was wrapped in “Try Catch” and in the catch part you can see that the previous data is no longer available in the exception.
But the presence would be of fundamental importance and helpful, since troubleshooting would then be considerably easier.
Kind regards