Datatable to data.column to add to another data.table

Hi,
I tried this: Extract only the specific column data from a datatable and create a new datatable with that column data - #2 by ImPratham45

But didn’t have much luck.

I have one dt1 from data scraping - it contains one column, ‘questions’
Within the same sequence, I conduct another moment of data scraping, which outputs another dt2 with one column, ‘answers’
I want to add the column ‘answers’ from dt2 into dt1 next to the ‘questions’ column.

so;
from this:
dt1:

questions
q1
q2
qn…

and dt2:

answers
a1
a2
a3…

to:

questions answers
q1 a1
q2 a2
etc

I thought I needed to use the ‘add data column’ activity - but maybe another activity might be better?

@Jroach - Say you have Answers in DT2

DT3=YourDT2.DefaultView.ToTable(false,YourDT2.Columns(“AnswersColumnName”).ColumnName)

Write Range : Write answers to your original sheet, Starting Cell B1, and Datatable as Dt3…

Hi @Jroach

Check this link

Hope it helps you

Regards

Nived N :robot:

Happy Automation :smiling_face::smiling_face::smiling_face::smiling_face:

1 Like

Hi @Jroach,

We can do in this way also without merge activity,

  1. Use Build datatable activity (dt3) and declare your required two columns
  2. Use Add data column activity and in the properties panel under input mention the column field as dt1.columns(“questions”) and datatable field as dt3.
  3. Use Add data column activity and in the properties panel under input mention the column field as dt2.columns(“answers”) and datatable field as dt3.

Let me know if you have any queries.

thank you - “add database” activity, do you mean, “Add Data Column”?

1 Like

Sorry, Modified :joy: