How to get key by value in Dictionary UIPath?

0 votes

Hi guys. 

I am using For Each to display each item using dict.values. The problem is I can't get key by value of the item in dictionary.  

Please suggest any ideas. 

.

Thanks.

Jul 6 in RPA by Slava
• 120 points
375 views

I think you forgot to initialize the dictionary, which is mandatory to add values to it and also to fetch values from it. Use Assign activity to initialize the dictionary.

1 answer to this question.

+1 vote

Hi Slava, I think you are facing this issue because you didn't initialized the dictionary. When you insert AddToDictionary activity to the sequence and create a dictionary variable you have to initialize it with newDictionary() method. You can initialize a dictionary in 2 ways:

1. Use Assign activity to assign dict variable to newDictionary(key_variable_type, value_variable_type):

  dict = newDictionary(Of String, String)

2. Initialize the dictionary while creating the variable by providing default value as newDictionary(Of String, String)

To understand better, checkout this thread: https://www.edureka.co/community/41092/can-i-create-dictionary-in-uipath-studio-and-add-items-to-it?show=41092#q41092

answered Jul 8 by Abha
• 27,180 points

Related Questions In RPA

0 votes
1 answer

How to access specific key and value from dictionary without loop in uipath

Hello, you can access value of a ...READ MORE

answered May 2 in RPA by Anvi
• 13,960 points
978 views
0 votes
1 answer

How to loop through a dictionary in UiPath?

Hey @Ravi, if you have a dictionary ...READ MORE

answered Mar 13 in RPA by Anvi
• 13,960 points
1,614 views
0 votes
1 answer

How to scrape data using Get Text from UI Automation tools in UiPath?

Hi Roshni, scraping any text from a web page ...READ MORE

answered Mar 20 in RPA by Pratibha
• 3,680 points
254 views
0 votes
1 answer

Robot Manager in UiPath

the robot.exe file is located in: C:\Users\USER_ACCOUNT\AppData\Local\UiPath\app-17.1.6523\Ui-Robot.exe Hope it ...READ MORE

answered Apr 17, 2018 in RPA by wrecker
• 3,110 points
460 views
0 votes
1 answer

Automation in Uipath

you can use the Database package for connecting  ...READ MORE

answered Apr 17, 2018 in RPA by wrecker
• 3,110 points
371 views
0 votes
1 answer

UiPath vs Workfusion

in WorkFusion, you can create a script ...READ MORE

answered Apr 17, 2018 in RPA by wrecker
• 3,110 points
1,114 views
0 votes
3 answers

Any open source tools for RPA ?

Yes, here is the Free RPA tool ...READ MORE

answered Oct 24, 2018 in RPA by Karthiksiddhu
• 240 points
275 views
0 votes
1 answer
0 votes
1 answer

How to filter messages in Get Outlook Mail Messages activity in UiPath?

Hey, you can use a RegEx expression ...READ MORE

answered Nov 7 in RPA by Abha
• 27,180 points
50 views