How to create 2D list in uipath

if found this code from learning site its creating list how could i create this type of list in uipath
and is this 2D list ?

IList<Student> studentList = new List<Student>() { 
        new Student() { StudentID = 1, StudentName = "John", Age = 13} ,
        new Student() { StudentID = 2, StudentName = "Moin",  Age = 21 } ,
        new Student() { StudentID = 3, StudentName = "Bill",  Age = 18 } ,
        new Student() { StudentID = 4, StudentName = "Ram" , Age = 20} ,
        new Student() { StudentID = 5, StudentName = "Ron" , Age = 15 } 
    };

Hi @Aleem_Khan

U can do something like this

Here each element of list_3 would be a list with object element type

Hope you got the idea @Aleem_Khan

Regards

Nived N

Happy Automation

@Aleem_Khan
the example is using a custom class (Student) along with its properties: e.g. StudentID
So it is differing from a simple 2 dimensional list

As the effort to make available a custom student class within a UiPath ( I guess LINQ learning project) is not in balance to its benefit for the learning progress, following can be done as alternate:

  • working with dictionaries (key can be used similar to property name)
  • working with tuples
    grafik

accessing the age: JohnTupleVar.Item3

so a list could look like: List(Of Tuple(of Int32, String, Int32))

1 Like

thank you so much peter for explain I am trying to learn linq query so as you said about tuple variable how can i create in uipath

was done in UiPath: Tuple.Create(…
also have a look here:

grafik

new Student() { StudentID = 1, StudentName = "John", Age = 18 } ,
        new Student() { StudentID = 2, StudentName = "Steve",  Age = 21 } ,
        new Student() { StudentID = 3, StudentName = "Bill",  Age = 18 } ,
        new Student() { StudentID = 4, StudentName = "Ram" , Age = 20 } ,
        new Student() { StudentID = 5, StudentName = "Abram" , Age = 21 } 

hi peter thank you so much for helping I have doubt how could I store this 3 value in dictionary as I know that dictionary hold two value for I.E key and value I want to store above list in dictionary could you help me how could I do that

Discussion continued here: