To pass variable as key in a dictionary and get the value of that key

Hello,

Can we pass a variable as key to Dictionary and get the associated value

eg Id=config(variable).tostring

config is dictioanry

Like config(“123”).tostring = abc

so can i use variable in place of “123”

Thanks
Divya

Hi @Divya123
Welcome to the UiPath Community!

Yes, you certainly can use variables to retrieve associated value.

1 Like

i have an assign with ID=row.item(“Site”).ToString
then when i use in_config(ID).toString…it gives error

How do i pass variable as key to a dictionary

Hi Divya,

Can you please post a screenshot of your code sequence?

Thanks @RPAForEveryone it works, i had wrongly typed variable name but autofill did not show it…so it got truancated …when i corrected variable it works

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.