Unable to create dictionary structure

uiautomation

#1

Hi,
I have two kinds of DataTables.
First One is like:-

Request Id
x
y
z

Second One is like for each request :-

| Attribute1 | Attribute1_Value |
| Attribute2 | Attribute2_Value |
| Attribute3 | Attribute3_Value |
| Attribute4 | Attribute4_Value |

I want to create dictionary structure like:-
Requests: {
x : {
Attribute1 : Attribute1_value
Attribute2 : Attribute2_value
Attribute3 : Attribute3_value
Attribute4 : Attribute4_value
}
y : {
Attribute1 : Attribute1_value
Attribute2 : Attribute2_value
Attribute3 : Attribute3_value
Attribute4 : Attribute4_value
}

}
how can achieve this in UIPATH.


#2

Yes it is possible.You have to create 2 dictionary one with x and one more with y as mentioning Attribute as key and Attribute_value as value.
ex: x=new Dictionary(of string,string)


#3

Sorry edited the dictionary structure in question. And main problem is that I don’t know vb.net to manipulate Idictionary object and not able to store in generic dictionary as I am getting error “not all generic types could be resolved”.


#4

@AMAN_GUPTA , please try Dictionary variable with nested dictionary as: <string, Dictionary<string,string>>.

Also, if possible you can have a object structure like
{
x : {
Attribute1 : Attribute1_value
Attribute2 : Attribute2_value
Attribute3 : Attribute3_value
Attribute4 : Attribute4_value
}}

and use Array of particular object.


#5

@Abhilash_Awasthi I can’t use System.Collections.Generic.Dictionary as I am getting error while declaring them "not all generic types could be resolved "


#6

The error is due to not going with type safe variables. Please check if the variables used are generic?
If yes, while assigning values in dictionary, please convert it to relevant data type.