How to use Add data row Activity

I have two datatables dt1 and dt2
dt1 contains
col1 col2 col3
47i ruk yfk
43 tulr6 lyruf
.
.
.
.

dt2 contains
col1 col2 col3 col4
xfy ruk zsr jcyf
stv tulr6 tdck hvc
.
.
.

and there is one more datatable which is empty i.e dtEmpty
I need to take 2 add datarows activity for for dt1 and one for dt2.

So,How to fill the dtEmpty
Bcoz my requirement is I need to take 1st row of dt1 in empty datatable then 1st row of dt2.Again 2nd row of dt1 and second row of dt2

plss help

Hi,

If count of dt1’s rows is same with count of dt2’s rows, the following will work.

Sample20220125-2.zip (3.0 KB)

Regards,

No datatable rows are not equal

column size of dtEmpty is same as dt2

How about the following?

Sample20220125-2v2.zip (3.3 KB)

Regards,

Here you have provided in second add data row activity
dt2.Rows(idx).ItemArray
what does it means?
and wht is idx?

what activity u have used here above write range?
It is not availble in my project.
Pls provide the package name nd activity name

Hi,

This returns items in idx-th row as object array.

wht is idx?

It’s index number of Dt1 or dt2’s rows.

Pls provide the package name nd activity name

Please see the following image.

img20220125-3

Regards,

activity which is used above write range

Can you clarify your problem?

In this xaml which activity you have used above write range.I m not able to see the activity in my project

please provide screenshot , so @Yoichi can understand better on the issues

regards ahmad

Hi,

Which compatibility do you use? if you use cross platform, you need to install Excel.Activites Package from Manage Packages as the following.

Regards,

What if I want dt2 values at a specific position of DtEmpty

Hi!

can we try like this

in first for each row read dt1->CurrentRow1.
take one more for each row and read dt2->CurrentRow2.

in add data row mention dt as your outputdt.

The output excel look like: col1-dt1|col1-dt2|col2-dt1|col2-dt2|col3-dt1|col3-dt2

in array of row mention like this:

{CurrentRow1(“Col1”).ToString,CurrentRow2(“Col1”).ToString,CurrentRow1(“Col2”).ToString,CurrentRow2(“Col2”).ToString,CurrentRow1(“Col3”).ToString,CurrentRow2(“Col3”).ToString}

in write range mention the dt as outputdt.

Regards,
NaNi

Hi,

We need to use DataRowColection.InsertAt method with InvokeMethod activity.

Regards,

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