Adding a string a data row variable

Hey! I have a variable that is a DataRow and I would like to add a value to it. What is the VB expression for that?

Thanks!

like this in Assign activity:
row("column name") = "my value"

1 Like

Hi
We got two options
If we know the column name or the column index then we can do this with a assign activity like this
Datarowvariable(columnindex) = “your value”
Or
Datarowvariable(”columnname”) = “your value”

Where column index starts from 0 for the first column

Cheers @jamills

1 Like

Hey all. Turns out I was being an idiot. I was attempting to treat a datarow as a list. So my solution was to add the strings to a list then convert that into an array and use the “add data row” activity.

Instead we can directly pass the Datarow itself to the Add Datarow activity for the property Datarow

Cheers @jamills

Hey Jamills, please check this demo

1 Like

Hey, thanks for posting! I ended up learning a little bit on how to manipulate datarows. Thanks again!

1 Like