How to keep moving if details in Excel is empty?

Dear Friends

There are some preparation at the beginning of my process

If there are details in the excel(sample1), then clear range(A2:H3), keep the headers
I know how to do it for this part

Sample1

If there is no detail in the excel(sample2), then continue to move on the following process
If I do nothing to modify my current process, there will be error pop up and process stop here

Sample2

PS: Sample1 and Sample2 are same excel file. The reason it could be no detail in it is that the detail are captured from relative emails. But sometime there will be no email to handle then it will be empty the next time UiPath open it

Thank you for your kind guidance as always

Regards
Ivan

You can use a read range activity to check if there are values on the excel file.

If (dt.rows.count > 0)
Proceed to delete the rows
else if (dt.rows.count = 0)
do nothing

Thank you for the prompt reply
But I don’t know why UiPath keep outputing β€œ14” while I only have header in the file



image

1 Like

Hi @yangyq10

Print datatable in excel. If you clear filter from input excel, maybe you can see 14 rows of data.

Thanks

Thank you for the feedback
I already clear the filter and there is no detail under each column
But somehow it still output β€œ14” after test run
No idea what causes this

1 Like

Try to delete row 2 to 15

Hi @yangyq10

If possible, can you please share the input file.

Thanks

Thank you for your support
Pls check the file I am using for the process
JACCS.xlsx (10.4 KB)

Hi ,
you can check if the excel is empty or not by giving a condition :

dt_table.Rows.Count = 0

image

I tried to use the file andthe rows.count is outputting zero

image

Thank you. I finally know the root cause is that I use [Clear Range] but not [Delete Rows] previously which cause row record in the file.

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