sapta_619
(Saptarshi Dutta Choudhury)
June 10, 2020, 1:05pm
1
Hi All,
I need some help, need to know a way how can we filter a data table from string array.
This is the data table:
Consider if we have a string array value {A,B} and i need the data table only for these two column, how to achieve this logic?
@ arivu96
Hy @sapta_619 ,
Unfortunately not!
At least for know to achieve what you want you must:
create a data table with build data table activity (col A and B)
loop through this excel via data table (for each row activity)
add records to the data table
Regards
ppr
(Peter Preuss)
June 10, 2020, 2:49pm
3
@sapta_619
If I got you right then you would like to achieve that a String Array defines which columns are to pickup.
In your case: {“A”,“B”} will pick up column A and B but not C
Give a play on:
A origin Table with three Columns:
A string Array with the needed columns
the line below is doing a filtering based on the ColList Array:
sapta_619
(Saptarshi Dutta Choudhury)
June 10, 2020, 2:58pm
4
Thanks worked fine. However i got the answer in this feed after i posted.
Hi All,
Use below code to remove empty row from the table.
DataTable name->DataTableName
Use assign activity
DataTableName=DataTableName.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(""))).CopyToDataTable()
Re-usable Component pass Parameter as datatable you will get the answer.
RemoveEmptyRows.xaml (8.5 KB)
Remove rows based on particular column is empty.
DataTableName.Select("Convert(column3, System.String)< >''"…