Check DT/Excel sheet contains Data

Hi all,

How can I check whether a data table/excel file contains data???

If so, how can I set up a if activity to send a email and end the automation when the datatable/excel file is empty?

Thanks.

???
I don’t see any solution.

Thanks.

Use Read Cell activity to get the data from the excel sheet and verify the using String.IsNullorEmpty(strvalue)
or
use Read Range activity to get the data from the sheet and store it into Datatable.

DatatableName.rows.count=0

@jasperlzx
you can check datatable.Rows.Count > 0
if count > 0, data exists. Else it is empty.

Hi @jasperlzx,

You can check the below scenario
1.Use read range activity to retrieve data and stored into a DataTable -
and check the DataTable rows count (dt.Rows.Count)
2.Use Read Cell activity to verify the data exists or not.

Regards
Balamurugan

1 Like