For each row of datatable, append new row value

datatable

#1

Hello,

I have a data table that I need to add values to. Essentially, I have a DT like this:
ID, City, State
AAA, LA, CA
BBB, NYC, NY
CCC, SD, CA

What I need to do is generate a value based on other variables, and add those values as a fourth column to the datatable. I’m assuming I create a new column, but then I don’t know how to append the values to their specific rows.

Any help is greatly appreciated!


Append only current row (in for each row activity) to Excel
#2

Hi @bdale04,

Use add data row activity to add the new row in datatable.

Regards,
Arivu


#3

Hi Arivu,

I don’t think that activity get’s me all the way there:

Starting datatable:
ID, City, State
AAA, LA, CA
BBB, NYC, NY
CCC, SD, CA

Ending datatable:
ID, City, State, New Variable
AAA, LA, CA, Variable1
BBB, NYC, NY, Variable2
CCC, SD, CA, Variable3


#4

Ok sorry I thought you want to add new row…

Use add data column activity to add the column in your table.

Use for each row to update the new column value.

Inside Loop use assign activity
Row("column")="value"

Regards,
Arivu