How to paste multiple data tables

Hi,

I’m trying to gather/paste 6 filtered data tables in one single excel, this needs to be one below each other, since is the same headers but information is from 6 different countries.

THANKS!!!

Hi,

Assuming you have used Read Range already and have all 6 data tables in variables with the headers all matching, then ideally, you would use the Merge Data Table activity followed by a Write Range.

Merge Data Table, will align all the columns up regardless of their order. If a column does not exist, then it will add the column (which is why the column names need to match).

The other option would be to use the Append Data Table or Append Range if you can assume the order of the columns will never be different between each table.

I hope that helps.

Regards.

1 Like

Thank you! I have one more question, how can I gather the variables in the Source field.

For instance: dtCountry1 + dtCountry2. I tried this but it keeps showing me error.

You can only merge one data table into the destination at a time. So you need 6 of them for 6 data tables.

Or you can use a For each (which is a good way to simplify code)
image

where you place each data table as an array, and srcDT would go in the Source field.

EDIT: change TypeArgument too on the ForEach:
image

Regards.

1 Like

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