Adding Datacolumn to existing Datatable and updating values in newly added Data column

Hi

I added Datacolumn of type double to an existing datatable and assigning values to the datacolumn with for each row activity and assign activities.

But when I rewrite the datatable to excel, I can see only values in data column pertaining to top row.

Below is the activity flow

Please suggest how to update values for entire datacolumn

Thanks in advance

Hello Bharath,
Please reassign Counter value to 0 before entering the while loop.
In the existing code, when the robot is processing the second row, the counter value is more than 60 and hence it never enters the while loop.
If this works please mark this as the solution .
Thanks

Do you need 2 variables doing the same thing - counter & index?

What values are you assigning to new columns? - same values per column? If they are same, you can do that by assigning a default column value, instead of iterating. Or, if values are calculated values, using an expression is the way.

Inside for each loop where you are assigning the values try to assign it via
Assign=>CurrentRow.Rows(index).item(“ColumnName”)= “your value”

Instead of current row(index) try this once @Bharath_Kumar3

It showing below error while using currentrow.rows(Index).item(“ColumnName”

BC 30456 - “Rows is not a member of Data Row”
BC 30110 - “Index” is a structure type and can not be used as an expression

Thank you all for the suggestions

It worked with Datatable.Rows(Index)(“ColumnName”)
instead of currentrow(“ColumnName”)

Depending on where you’ve initialised the Counter and Index variables (For Each Row Vs While), you could be unnecessarily looping and wasting time and the CPU cycles.

Doing a

could be just masking the issue created by the While loop!
Maybe, if you could explain the use case, a better solution could be offered.