Add column with Name and Value in each row

Hi,
After I read range with headers and got dataTable, what’s the best way to add/append a column with header and same values dynamically for each row to this dataTable?
Thanks

you want to add values to same datatable without changing the header ?

1 Like

Yes, to this datatable which I’ve read. Just append the new column like:
Header
value1
value2
value3

use assign activity like this
yourDataTableVariable.Columns(0).ColumnName = “value1”
yourDataTableVariable.Columns(1).ColumnName = “value2”
yourDataTableVariable.Columns(2).ColumnName = “value3”
cheers @Slavich

1 Like

@Slavich
Use “AddDataColumn” activity - this will create a new column.
Then add values to it by using assign activity.

1 Like

I need firstly to add new column…

yes!
you can use data column activity! there itself you can change the column name!
if you want to change only the column name in the same datatable without changing the data in it you can use above syntax!

1 Like

You can add data column in Previous datatable using
Add Data Column
U can give Any name in properties
Then for assigning values in that columns Use For each row

1 Like

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