I’m trying to pass the data from two columns to a new DataTable object But when I get these columns with ’ Read column ', I obtain an IEnumerable object so I can’t save it in the DataTable.
I have looked at the previous publications to see if they could help me but I can not find something to guide me.
I think it might be better if you read your columns with a Read Range activity. If they are next to each other, then you only need one Read Range activity and then you can work with Data Table variables rather than IEnumerable.
Merging two Data Tables should not be a problem then.
Hello @loginerror , sorry for not answering before, the columns are not together, they are separate, which would be worth to get the data from a single column and then take the next one I would like.
The way you tell me already try but I can not get a column in a DataTable variable, thanks.
If I try but that activity if I’m not wrong is to create a new Column and I do not want to create a new column, I want to take the data from one column of an excel, then take another and both put them in a DataTable to be able to paint it in an excel sheet Thank you
@joseluisgomez82 Try this component.
dtMasterData is your original Datatable.
In the second assign you have this statement
dtFinalData = view.ToTable(“TableName”,false, “ColumnName1”, “ColumnName2”).
Simply replace ColumnName1 and ColumnName2 with the names of the columns in your original DT and they will be created in your dtFinalData.
You can easily add new columns to the same statement like: view.ToTable(“TableName”,false, “ColumnName1”, “ColumnName2”, “Column3”, “Column4”, etc…).