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 7, 2019 in RPA by Slava
• 120 points
7,143 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, 2019 by Abha
• 28,140 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, 2019 in RPA by Anvi
• 14,150 points
9,064 views
0 votes
1 answer

How to loop through a dictionary in UiPath?

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

answered Mar 14, 2019 in RPA by Anvi
• 14,150 points
1 flag 11,418 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, 2019 in RPA by Pratibha
• 3,690 points
2,295 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
1,883 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
1,608 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
2,718 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
1,849 views
0 votes
1 answer

How to get the desired packages in UiPath Studio if not available in Package Manager?

Steps to get your desired package in ...READ MORE

answered Oct 15, 2019 in RPA by Abha
• 28,140 points
2,573 views
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, 2019 in RPA by Abha
• 28,140 points
9,646 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP