How to get Int32[] from Datatable

I want to writeLine Datatable.
I have question with attached samplecode.

  1. the datatable have 3 rows
    but For Each Row loop 4 times
    forst row is empty

  2. how can i get int32 type data from the datatable?
    The data of string type is output well, but the int32 type is not output.[Main.xaml|attachment]
    can you help me?
    (upload://x6CoQz44uxcbYg4b3hzTw02uSXg.xaml) (15.7 KB)Main.xaml (15.7 KB)

For this while reading with read range mention the range as “A2” so that it will start to read from second row
Or
To avoid empty row
Before for each row loop use a assign activity like this
Yourdatatable = Yourdatatable.AsEnumerable().Where(Function(x) x.ItemArray.Any(Function(a) Not string.IsNullOrEmpty(a.ToString))).ToArray().CopyToDatatable()

Suppose you have a string “123” in the datatable in a row of a column then to convert that to a int32 be like
Out_value = Convert.ToInt32(row(“yourcolumnname”).ToString)
Like
Out_value = Convert.ToInt32(“123”).ToString

Where Out_value is variable of type int32

Hope this would help you
Cheers @alisha

3 Likes

can you see my attacted file (main.xaml) ?
now column type is int32, not int32

so i don’t know how to get type int32 column value

Hi @alisha,
You need to import the namespace newtonsoft.json.
Then use JSONConvert.SerializeObject(row.Item(ykkTempi)) instead of row.Item(ykkTempi).toString.

The alternative is to identify type int32, and then with a foreach loop print every int32 individually.

Hope this helps !

@alisha,

Please find the Xamls file.
AddValueinDatatables.xaml (20.5 KB)

Please let me know if u have any issues…

Thanks
Sanjay