Multidimensional arrays

Hello.
Please, explain how to work in UiPath with multidimensional arrays? How to declare them and how to write value into them after declaring?

1 Like

Hi Fitc!

You declare them putting a “For each” into other “For each” (first for rows, second for columns).

EDIT:
You write values inside of second “For each”.

For each row {
For each column{
variable = value
column = column + 1
}
row = row + 1
}

I hope help you.

Java, thank you, but that’s not what I asked for.
What variable type should I use to create a dynamic multidimensional array?
If I use array(of array), I can’t change the size of the array.
List doesn’t work because if I try to write a value into it, for example, list(1)(0)= 111 , list(2)(0) also becomes “111”.
What I want is declaring like list_new (2,3) as string (or any other type).

Do you try it with datatable?

Declare datatable and fill it with array values.
You can add rows or columns if you need it (on database).

Yes, I also tried datatables, but also got no result.
This problem could be easily decided by switching off the “strict on” option, because I can declare an array and then initialize it like list_new=new int32(5,5){}
But because of "strict on"option I can’t write any value into it

I did multidimensional arrays with two simple arrays and a database, and works great.

Please, post pics of your flowcharts.

Java,
we can send examples of your work? This will greatly help

I also need the solution for 2 dimenational array string ,i am not able to store the value if you know how to store it please let me know

Attached is solution for Jagged Array incase if it supports your requirement.

jaggedArray.xaml (8.9 KB)

2 Likes

I couldn’t locate the String (array of arrays) type in the .NET type browser. As a workaround, I had to copy the file to my project in order to open the variable type and make it visible to my sequence. I wonder how it is call this type to find it in the browser…Thanks @vvaidya! :slight_smile: