Is there any way to do isnull and whitespace in Filter Data Table?

I’m currently trying to set up a way to determine the value of a blank space in the Filter Data Table. However, when I look at the Filter Data Table, there is only IsEmpty, and I am looking for a way to determine IsNullOrEmpty and IsNullOrWhiteSpace.

2021-11-14 (2)

If you know of a way to filter “IsNullOrEmpty” and “IsNullOrWhiteSpace” in the Filter Data Table, please let me know.

Thank you very much.

1 Like

Hi,

IsEmpty of FilterDataTable activity works like String.IsNullOrEmpty.
However, If there is any whitespace, it’s not recognized as empty and there is no operator for it in FilterDataTable.
So, you need to use LINQ etc to filter by it, or replace whitespace only data to String.Empty in advance, then use IsEmpty, i think.

Regards,

Yes you are right
For now we have got only IsEmpty as a filter option in FILTER DATATABLE activity
Hope In future release it will come

But still you can try like this
Use operator = and in value mention as Nothing

Or

for this scenario we can simply use a assign activity with a expression like this

Dt = Dt.AsEnumerable().Where(Function(a) String.IsNullOrEmpty(a.Field(Of String)(“column name”).ToString) ).CopyToDatatable()

It does the same what you expecting

If you need for multiple columns to be validated then the expression will be like

Dt = Dt.AsEnumerable().Where(Function(a) String.IsNullOrEmpty(a.Field(Of String)(“columnname_1”).ToString) AND
String.IsNullOrEmpty(a.Field(Of String)(“columnname_2”).ToString) ).CopyToDatatable()

Cheers @Kirigirisu_Coin

1 Like

Thanks to you, I’ve decided to make it with expression.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.