Check DT/Excel sheet contains Data

datatable
excel
uiautomation
email
activities

#1

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.


#2

#3

???
I don’t see any solution.

Thanks.


#4

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


#5

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


#6

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