Create datatablee

How to combine two IEnumerable(object) into datatable

1 Like

Fine
we can use copytodatatable() at the end of the ienumerable expression of first datatable
and assign it to a datatable variable with a assign activity
then repeat the same for another dattable activity in the assign activity
–now use a merge datatable activity and mention those two datatable in the source and destination
where destination is our final datatable
Cheers @Sweety_Girl

2 Likes

I need my first ienumerable to be the 1st column and 2nd as 2nd column

Then loop the first enumerable and use add data row to make the values add to the first column

and loop the second enumerable and add data row to add the second column values @Sweety_Girl

2 Likes

How to make the second loop to write in the 2nd column @HareeshMR

1 Like

Bcz add data row adds the data in the next row… How to make it write in next column?

1 Like

Yeah, that was a great point., we have an alternative to do that @Sweety_Girl

Please do this steps

  1. Loop the first enum and make it as a array
  2. Loop the second enum and give the values for add data row as {array(index), item}

I hope you understand

2 Likes

We have to increment the index value, right??

Yes, create a new integer value and increment the value in the for each loop everytime @Sweety_Girl

How to add the data in array

Here is the screenshot @Sweety_Girl

But the index should be dynamic. So make the value of zero as dynamic by declaring a variable and increment it everytime in the loop

image

1 Like

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