Adding Data to a specific column which has a dynamic column name and position in Data Tables


I’m adding a column to an existing data table with column heading to be today’s date. In the add column activity under ColumnName input i say DateTime.Now.ToString(“dd-MM-yyyy”). As i am adding data every day to the table as above the index value of this new column will also be dynamic.

Now i want to add values to this from another column in this table. Based on post on the forum i found i tried this by using assign activity; row.Item(“DateTime.Now.ToString(“dd-MM-yyyy”)”) =row.item("columnname) under for each row activity. However when i give it as above (for today date column) i get an error Invalid L-Value expression.

Could anyone help me solve this?

1 Like

You are trying to change something which is used to loop through. Get the value inside and exit the loop then assign it to the required and check. Hope this works

You were almost done
Remove the double quotes inside the row.item
That is it should be like this
row(DateTime.Now.ToString(“dd-MM-yyyy”)) =row("columnname”).ToString

Cheers @tharinda

1 Like