Delete "columns X " due to reading empty columns in Excel file row in a Read Range Activity

Hi, community. I need help, please.
The workflow is that I read one excel file row and It has columns.

image

I’m giving a range “A1:A12”.
When I delete some columns from the excel file on purpose, the activity reads those values and It gets like this
“[ID,Date,Column30,Signo Duración,Week,Problems,Column1,Column2,Column3,Column4,Column5,Column6
]”

In the future, It might change due some coworkers might delete the first and second column for example I think It would be like this:

“[Column1,Column2,Column30,Signo Duración,Week,Problems,Column1,Column2,Column3,Column4,Column5,Column6
]”

I’d like to delete those “Column numbers” from the data table, any idea?
Thanks.

YourDT.Defaultview.Totable(False,{ListofYourColumnNames}

Hi @pprin001

in addition of @Gangadhar_Athili suggestion

Try like this too

Method 1

  • Read Range and store in DT
  • Use Filter datatable and in the wizard navigate to output columns and pass all the column in the wizard and set the column selection mode as Keep

Method 2:(Dynamic method using Excel)

  • Read Range and store the datable in the variable DT
  • Loop through columns and add the column1 ,column 2 …, etc in the list
  • Loop through the list and look up the column and Delete them

Here is the sample xaml file and output file
Main.xaml (12.4 KB)
File.xlsx (9.1 KB)

Method 3: (Dynamic method with Datatable)

  • Read Range and store the datable in the variable DT
  • Loop through columns and add the column1 ,column 2 …, etc in the list
  • Loop through the list and remove the data column

Here is the sample xaml and output file
WithDataTable.xaml (10.6 KB)
File.xlsx (9.1 KB)

Hope this Helps

Regards
Sudharsan