Hi,
I’m trying to filter rows from a data table, with date > “2017-30-12” but i don’t got any result.
Did anyone know why ?
Tx
Doanh
(Do Anh)
March 24, 2020, 12:36am
2
@Hadrien_Poquet
Filter DataTable only works with STRING data type column.
For other data type (int, date), you have to use other way as For Each Row or expressions
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)< >''"…
Hi @Doanh , Do you have the expression that fit in an if activity ?
Tx
This is not remotely true.
@Hadrien_Poquet
What is the datatype of the Date column?
Hadrien_Poquet:
date > “2017-30-12”
@Hadrien_Poquet , Please ensure DataType of your date column is DateTime.
Cheers
Doanh
(Do Anh)
March 25, 2020, 2:14am
6
@DanielMitchell
Sorry it’s my mistake.
In this case, how can we extract structure data to a datatable variable with datetime type column?
@Hadrien_Poquet
You can try this
Assign dt_WorkItems2 = dt_WorkItems.AsEnumerable().Where(Function(x) CStr(x(“Description”)).Equals(“Verify Account Position”) And Convert.todatetime(x("Date).ToString) >= Convert.todatetime(“2017-12-30”)).CopyToDataTable
To use CopyToDataTable method, you need to add System.Data.DataSetExtension library
Hi @lucas.mcgonagle
EDIT
20.10 fixed this issue for newly created projects.
You can fix it by adding the Assembly Reference manually in your xaml file:
[image]
Simply open the file in Notepad and create new line with this String:
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
Then reopen your project and the error should be gone.
Please be careful while doing so and always keep a backup.