Hi there,
I’m getting a data type mismatch as my Dictionary isn’t initialising managing to initialise before adding items to it. I’ve attempted to initialise it at the start but UiPath doesn’t seem to recognise it.
The workflow is trying to:
Generate browser variables, and store each with an associated name/description. So for example I may have the following:-
<“Chrome Bla Bla”, BrowserChrome>
<“Firefox Bla Dee Bla”, BrowserFirefox>
Here is the syntax error:
Compiler error(s) encountered processing expression
“out_browserDictionary”.
Option Strict On disallows implicit conversions from
‘System.Collections.Generic.Dictionary(Of String, UiPath.Core.Browser)’ to
‘System.Collections.Generic.lDictionary(Of Object, Object)’.
Here is my setup:-
Studio 2020.2.0-beta.108 - 9/11/1953
Community License
EXE Installer
License Provider: Internal
Activation ID: UIP-e12938c6ec
Update Channel: Preview
Microsoft Windows 10 Enterprise 64-bit
.NET Framework Version 4.7.2 or later
Remove the existing Add to Dictionary activity and add it back again with the right type <String, UiPath.Core.Browser> that should resolve your error.
Secondly, the Count condition will throw an error when you compile. To avoid that, I recommend initializing the dictionary no matter what (it’s an out type argument so you have to initialize inside before sending out)
Hi there,
I can’t add screen grabs to posts so I’ll try explain as best I can.
I don’t get the window box appearing that allows you define the types when you Add To Dictionary, that is from this post…
…I just get the Add To Dictionary Window, with the three text fields: Dictionary; Key; Value. This screen seems to be the screen I need. I sound like there is a bug somewhere as if you click below the activity it shows for that user. Not for me though. Arghh!!
As you can tell from my original post, I’ve already tried using the Assign to initialise the Dictionary, as per this suggestion…
I’ll try the other suggestions and respond accordingly.
Hi PD2,
This was actually the first thing I tried, and yes I had spotted the mistake in using the Count condition. I’ve changed this to “out_browserDictionary is nothing” to identify an uninitialised Dictionary, then after that I’ll check for the Count. However, if I can initialise the Dictionary fine I may be able to ditch the “is nothing” test. ANy thoughts?
Cheers
So I’m assuming UiPath is a little buggy still? I don’t feel like i’m trying to do anything too unusual. I’m new to UiPath, but I’m a developer, and this really feels quite basic functionality that is available to use, but doesn’t work. Or does it work for everyone else and not me?
Unfortunatelly, I cannot tell since the computer I was working for, I don’t have it anymore.
But I believe that its the most recent one, since I just tried it on the version that has cloud so it should be 2019-2020.
If you are still having issues (which I hope you don’t), I can retry again.