How to check if datatable has no row

Hello everyone,

I need to check a datatable has no row or one row. That is why i used an if activity but this activity doesn’t work correct. I have run it in debug mode and see it always says the datatable has no row. But the datatable has one row. How can i fix it ?

here is if activity;

and here is datatable;

1 Like

get the count of rows in a data table.

If your data table has no headers/columns, set Include Headers to False in the extract data table activity.

OrElse will evaluate both boolean expressions only if the first expression returns false.

If the first expression returns true, then the second expression will be ignored.

Karthik Byggari

the Two conditions used in your if should be like this
dt_ozel.Rows.Count = 0 OR dt_ozel.Rows.Count>=1
Cheers @mazlumkacar


When my datatable is empty it still has headers and columns but no row.

My problem is; when datatable has row it still go into “Then”. But it must go to “Else”. I am try to find how can i create this workflow correct.

Yah this expression will validate that
As in your current condition it both checks for empty rows only And not whether it has records or not
That’s why buddy
Cheers @mazlumkacar

1 Like

When i try this code getting this error.


1 Like

Make sure that the variable datatable is set to global scope from from a read range activity
That can be set in variable panel
Cheers @mazlumkacar

“Nothing” represents the default value of any datatype.

It might be that the first expression (dt_ozel Is Nothing) always returns true so try to work without it.

Your other error means that dt_ozel doesn’t have any value and therefore can’t be evaluated. So when you test this activity, make sure your DataTable is not empty.

Let me know if that worked

1 Like

it worked when i use this

and you all right about error. i have just forgetten my datatable scope. when i fix it it start to work.

Thanks and Cheers



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