How to fectch an array of strings from a datatable column

Hi Devs,
So I’m building a datatable using Build Datatable activity.
It has 3 columns 2 of type normal string and the last one Array of Strings.

Now I’m able to add rows to it using add row activity but the problem is when I’m retrieving that 3rd column.

Is there a way to typecast or is there any alternative solution.

Screenshots and detailed explanation.
Datatable = temp

Adding rows into it using add row activity
{“foo”, “bar”, “String 1 ~ String 2”.Split(“~”.ToCharArray) }

The problem
I’m unable to access the string array using
temp.Rows(0).Item(2)(0)
(0) is the first of the string array and it should return “String 1”

Thank you in advance.

Can you try this @TuhinBagh,
I’mot sure this will work, but give a try :slight_smile:

datatable.Rows(0).Item(2).ToString(0)

Thank you for the response @HareeshMR.
I tried your solution and it outputted “S

Which made no sense at first then I used just
datatable.Rows(0).Item(2).ToString()

The result was “System.String[]

Is there a way to solve it? I’m thinking typecasting maybe?
This makes no sense if the datatables allows a column to be an array of strings, why it is so difficult to retrieve that information?

I tried a few different things and it is still not working for reasons I can’t figure out! I tried using linq to convert, but am getting a cast error for an unknown reason: dt1.AsEnumerable().Select(function(x) x.Field(Of String)("StringArrayColumn")).ToArray()

Although not ideal, is it possible to add it as a string instead of a string array? Then you could split it into an array after pulling it from the datatable.

Thanks @Dave
Seems like I have no choice but to save it as a pattern separated string for time being till UAT.
But it will surely raise some eyebrows during code review. :frowning:

Is there any way we can raise a concern to the uipath team? As there is no official documentation about this.

Yes,

it returns a character. Looking for a way to get the entire string :slight_smile:

Will get back to you if I find any @TuhinBagh