Extract data table for check data

Hello,

I use extract data table for get data but sometimes have data or empty data.

image

I want to check data that empty or not.

Please guide me for solve it.

Thank you

Hi @Stef_99

Try this:

If 
  ExtractedDataTable.rows.count = 0
Then
  DataTable is empty
Else
 DataTable is not empty
End If

Regards

Hi @Stef_99

Simply you can try with If activity

If yourDataTable.Rows.Count > 0 Then
    ' DataTable has data, perform your actions here
   
Else
    ' DataTable is empty, perform other actions here

Cheers!!

@Stef_99

you can use filter dattaable and filter for empty rows

then get count

cheers

now I use rows.count output it same =1 as below.

image

Please guide me for solve it.

Hi @Stef_99

Try this:

If
 dt.Rows.Count <= 1 AndAlso dt.Rows(0).ItemArray.All(Function(x) String.IsNullOrEmpty(x.ToString.Trim)) 
Then
    Datatable is empty
    Perform actions here
Else
    Datatable is not empty
    Perform other actions here
End If

Regards

1 Like
isNothing(yourDTVar) OrElse yourDTVar.AsEnumerable.All(Function (x) String.IsNullOrEmpty(x(0).toString.Trim))

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