Datatable that contains column of datatable

Hello,

I am trying to work with a table that contains a column with other datatable. I was wondering how i access the table that is saved in that column? I am currently looping through the main table but havent figured out how to access the rows datatable.

Any help would be appreciated.

Hi @Ninjabullen

So you’re saying that there’s a table inside a table.

and you want to access that?
Loop Outer Table:
currentRow(“SomeColumnName”) would be having your second interior table, so use this as a string input to generate dataTable and use the correct delimiters to obtain the data.

Thanks

I will show with some images as an example.

Main table

Test Table

The loop to add test table 10 times in main table:

Trying to access data and its not working:

The result from currentrow(“Tabell”).ToString:

Hi @Ninjabullen

Since you are adding the data table to the second column of the main table, you need access the same as a data table. Since you are trying to access it as a string like currentrow(“Tabell”).ToString, you are just getting the tableName string as output.

Hope this helps,
Best Regards.

1 Like

Hmm, but how do i do that. Do i need to assign the second column data as a temporary data table to loop through?

@Ninjabullen

You can try casting that column data into a data table, thus you can try something like this:

innerTable = DirectCast(currentRow("Tabell"), DataTable)

Hope this helps,
Best Regards.

1 Like

Works like a charm.

Thank you very much.

@Ninjabullen

Glad this one worked for you. Happy Automation!

Best Regards.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.