Adding to each Row

Hi all

I have to add a new value to each row in a Datatable
I have created a new column to store the data in, and in a “for each row” i assigning the value to the cell. So far so good.
Now the value is a random number, so in the start of the loop i run a small randomiser to change the value of the variable i want to put into the table.
In the next assign part i use the code
ExtractDataTable.Rows(0)(“rindex”)
With index being the column ofcause
However this only writes to the first row, not the other 504 rows (because i says "rows(0) i guess
What should it look like if its not row specific and hits all rows?

@jeppethoftgaardjakobsen
Welcome to the forum

Can you please reformulate your requirement description into a clear form what is to archieve. Feel free to share a screenshot of your current flow

In case of your datatable is already populated and you want to insert a random value into all rows:

  • Iterate over all rows with a for each row activity
  • yourForEachRowLoopVariable(YourColumnnameOrIndex) is the statement to set a value to current row of iteration
2 Likes

Reading over it, i see it might be kinda hard to understand.

I’m basically looking for the code the goes in to part of the last assign
For Each Row

as mentioned above
within the assign activity
left side: row(YourColumnNameOrIndex)
right side: rand

1 Like

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