Copy data from datacolumn in a new DataTable

I need to copy the information from one column in a datatable to a specific column in another datatable I’m working with excel files that are not standarized and the column names can be different, what I’m doing is using an aditional file with the possible column names that I need to look for and the column name that I need to consolidate the data(lets call it MappingColumns File) where ‘Column Type’ is the column name that I need for my consolidated datatable and ‘Column Name’ is the possible name that will comes in the report depending of type

the report columns looks like this:

Now I filter the MappingColumns by ‘Type’ and stores filtered rows in a new data table ‘TypeTbl’

I set a string variable called ‘oldcolumn’ to “”
I loop ‘TypeTbl’ this way I get a new DataTable with the column structure that I need to consolidate the report

and now loop for each column in report and comparing if the column name is equal to ‘Column Name’ value in ‘TypeTbl’ by doing a for each row in TypeTbl

so if the column name matches with the value in ‘Column Name’ TypeTbl I want to copy the data into ConsolidatedDT

Hi @c.ruiz.chojolan,

Welcome to UiPath Community!

  • Use the copy data activity to copy the cell range data to clipboard
  • Use clipboard to Data table

Thank you

1 Like

I have solved this building a data table column by column and row by row

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