How to find the Excel Doesn't have record?

Hi all,

I have to Check whether the excel have some Records/Data or not ? (Need to Determined using If -else)

E.g : Excel A

I have used the Read Activity and Set Variable as “Dt”

Then i took Assign Activity, with Variable “No_of_row”

No_of_row= Dt.Rows.Count

If No_of_row >0 then

“Excel have some Value”

Else

Send a Mail (Mail Activity) : " No Data"

But on else part i was getting error. When Excel is empty it is throwing Error. Can any one help on this one ?
@Palaniyappan

Thanks in advance,
Jayavignesh G

1 Like

give a try on following condition:

isNothing(Dt) OrElse dt.Rows.Count = 0
it will be true if dt is null or has no rows
it will be false if dt has more then 0 rows

Hi @Jayavignesh_G

Please refer the xaml below.

Main.xaml (26.8 KB)

Best Regards

Hi @Jayavignesh_G

Here you go with a process on it
I used the same condition and is running fine as expected

RowCount.zip (9.1 KB)

cheers

Yes… You are Correct My Method Is correct. There is Spell in Variable… Hahaha.

Thanks a lot @Palaniyappan for proofing me that i was correct !!