I am trying to add Excel file Headers into newly created Datatable. Can anyone please please help to fix this.
I have attached the dummy workflow which I have created.
I need to copy Headers from “Wiki_Macro_Column_Headers.xlsx” file into Datatable created from CSV file Before apply filter in Datatable and that should reflect into file “Entire_Updated_Data.xlsx” after created.
Dummy Project.zip (191.6 KB)
Plz check Add Headers property of Read Range when you plan to read excel sheet.
you can also filter datatable based on column index 0, 1, 2 etc.
Is it not possible ti filter datatable as per column header name? instead of index.
The reason is I am not sure how many column will be there in file, But header name will be there on any index number.
Hence I want to filter the datatable as per name.
Plz try with Add headers property, you will achieve it.
There are some ways to achieve it.
The following is to use string manipulation. Hope this helps you.
Sample20210608-1.zip (11.8 KB)
That I already used and that will give me the output as Column1, Column2,…like this.
But I need this column headers as like below.
And this Column headers I will export from already saved Excel file.
My simple requirement is Before applying filter on datatable Column1, Column2…headers should replace with standard headers.
Another way: iterate datacolumn. (See sequence.xaml in the attached sample)
Sample20210601-1-v2.zip (2.8 KB)
I guess by looking at screenshot the file which you use has no headers, right?
that is why their names are as column 1, 2
before you read it, will have to write column names using write cell activity or follow @Yoichi’s solution.
Can you please tell me what you mentioned in Assign activity under For Each.
Unfortunately As per sample solution it is not working.
Sorry for i attached a wrong project.
Assign activity under For Each.
TypeArgument of ForEach is DataColumn
thnx for reply,
it give me the error.
If possible can you please upload correct project.
Can you try the following? (Sorry, I cannot check expression in Studio now due to I’m out)
Yoichi, I have put the Columns(idx) as Column(0), but every column gets updated in the same column only, How I can increment the column?
We need to set idx at index property of For Each.
The following is what I want(ed) to share. Can you check this?
Sample20210608-1_v3.zip (12.0 KB)
thnx Youchi, it is working as per my expectation.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.