Intelliprompt - See initialized keys of dictionary or similar

Hello!

I’m wondering if there is a way to see the values from an initialized dictionary in the suggestion box

I have this dictionary, is there a way for it to autofill when I type the keys?

There was a similar post from 2021. Has something changed since then? What other options do I have? I don’t know how to create the class like the post said, in case it’s the only option.

Thank you.

This is what you are looking for?

If yes, to effectively use your dictionary in UiPath Studio, here are the most common operations and how to perform them

Hi Marian,

Thank you for the information, I will save it for reference, but it’s not what I’m asking.

I want to find a way to add default values to a dictionary and then be able to see the keys while I’m using the variable

An example from a different Automation tool: I add a dictionary and I get the default values suggested, so I just select one to add it without having to type it

image

UiPath doesn’t seem to have a direct option for that, but it seems there could be solutions like in the post I shared, but I don’t understand it and can’t tell what other options I have.

P.S. I don’t have access to DataServices or its modern equivalent, I’d like to try with a class but can’t tell what it is supposed to do.

This isn’t a UiPath limitation here but how .NET compilers run.
The intellisense evaluates what is known as ‘design time’ information, that means stuff it knows without running the code.

It cannot know what values are in your dictionary without running the code.
The solution is quite simple, and one I have advocated for years.
Ditch the dictionary. Its not fit for purpose and is a legacy approach from back in the day when UiPath was severely limited. Its not had such limitations for a long time.

What you want to do is make a C# class as the original post you reference suggests. This is extremely easy these days, especially if you ask your preffered coding agent to do it, even a basic GPT works perfectly on this. UiPath have added full support for it.

Give it your dictionary and say you need a C# class and make sure to include a constructor.
Then in UiPath make a new file of the type ‘Coded Source File’ as distinct from a coded workflow. This allows you to just write your own classes and objects in the project.

Then in your workflow add a new variable using the name of the class you just made.
Voila, you now have your object and it works with intellisense defining the fields you want. This is because you now gave the designer a concrete object to understand, whats more you can use better data types, you can use dates, or booleans properly without casting or messing around.
If you want default values thats no problem and can be done via the constructor.

Learn the basics of building a class and you’ll never look back on Dictionaries. They are not a good standard to work with.

Hello Jon,

Thank you for the answer! This is what I was looking for.

I’ll mark it as solved and try it in my project. :slight_smile: