"Create" variables in Excel?

Hi Guys,

Not been here for a few months, I understand we have had major imrovements in Studio, congrats to all concerned.
Is it still not possible for Studio to read the variable name and value from Excel then create these pairs , I know we can easily get the value but not create the variable.

Screenshot 2022-12-15 202211

Thanks Guys :grinning:

@MikeC Like Reframe work,we could read the values and add it to dictionary and then we could get it from dictionary variable

1 Like

You wouldn’t want to do that, anyway. A dictionary is the appropriate solution.

1 Like

Hi Guys,

Thanks for that, unfortunately the dictionary activities is not yet supported in the updated Studio.
I have succesfully created New Dictionary(of string,object) which is probably the same thing as the activities.
This works fine, gets the values perfectly.
But calling these vars later in the game is a bit cumbersome to say the least, think I will pass on this one, thanks again :ok_hand:

What? Dictionary is a standard datatype. It’s fully supported by UiPath.

It’s not, and it offers capabilities that variables don’t. Like being able to loop through all the name/value pairs in the dictionary, being able to check if a certain key exists, etc.

Meaning the activity, drag n drop from activity pane, not the actual datatype.
Its not available in “manage packages”.

It bloody well is cumbersome :joy: , for me anyway lol, unless im doing it wrong.

Lets say a bog standard var, MyFolder.
When calling this later I can select from dropdown / use variable etc.

Wheras using the dictionary I have to…
Config(“MyFolder”)

Where “Config” has the value “New Dictionary(of string,object)”

Screenshot 2022-12-16 181529

Care to point me to a YouTube video ? Ive watched a few and they are all the same really.

You don’t need an activity. Just use Assign. Treat Config(“Some Name”) as a variable.

Assign Config(“My Key”) = “My Value”

Of course since the dictionary is “of string, object” the values can be string, or datetime, or int32, or double, or even complex things like datatables and arrays.

Dictionaries are very powerful and are the correct way to do config files. Read Range from Excel into a datatable, then…

image

Just as simple as that, now you have your name/value pairs from the Excel config file in a dictionary. Totally dynamic, just add whatever name/value pairs you want to the Excel file and you don’t have to touch your code.

In all honesty, if Config(“Some Key Name”) is too cumbersome for you, programming isn’t for you. That’s a very simple, simple thing compared to what you’ll need to do in order to automate full processes.

You’ve also got the option to read the table and assign each to a global variable (new in 22.10), but I’d agree with all of the above; stick to the REFramework/config file route.

So I should quit ?
Im not a programmer, dont want to be, im a heating engineer, not that it matters.
I just find what these softwares can do is amazing, UiPath / Power Automate etc.
Consider it an interest / hobby of mine.

I said the dictionary “activity” isnt available in the latest updated Studio and you came at me, that wasnt appreciated.
I used assign instead, all works perfectly.
However, I found it a tad cumbersome calling these variables later in the automation, thats my opinion, not a fact, an opinion…

Im quite thick skinned, you have not caused me any distress whatsoever, infact you have helped me out many times before which I still appreciate.
But I do feel you can at times be a little sharp when conversing on this forum.

Mike

I’m just matter-of-fact. I didn’t come at you. I find no need for sugar coating things in a technical world where things either are or they aren’t, there’s no gray area.

But thats the fact of the matter, the activity isnt available, yes its a fully accessable datatype, these are completely different.

Lets move on :ok_hand: