How to make datatable with variable number of columns?

I’m making a datatable, but the number of columns and rows needs to be different from one run to the next. How do you make a datatable where the number of columns is a variable?

@stefan count the number values in array or any other thing. Use loop, inside it use add data column for each values. Based on values u number of values u get, different number of columns are created.

So there is no way of making the datatable ‘‘directly’’?
Like New DataTable(x_rows, y_columns)

@Stefan1 i dont have knowledge about that.

Okey, thank you!

DataTableSample.xaml (7.6 KB)

Here you go, please check the sample. :+1:

1 Like

@bala_subramanyam great, thank you!

if it helps you, please mark it as a solution

Append range is your friend.

Check this out

Append Range