How do i know if a cell is empty?



Between the various conditions of a " if" I have to enter if the cell is empty


x<1 or x>2 and y.ToString.???

I looked for “isEmpty” but there is not


check this…?


isNullOrEmpity("") is not member of uipath.generic.Value…I assign to Y value “generci”, because if I assign "string"
I have another mistake beforehand, in “read cell”


If you want to check if the variable is empty then

if you want to check if the variable just contains an empty string like “”, then

I think those should work.



what mistake your referring to? You just have to do proper conversion .:wink:



please, give me an advice…

I want find first empty cell and paste to this empty cell (under the existing data) new data. But my robot doesn’t work well

Thank you in advance for your help :slight_smile:


Hi @vhlavacek
=nothing or Is Nothing will only check if the variable has something stored in it.

What you really want is ="" , so the empty quotes means empty string
aHodnota.Trim = “”

Hope that helps.



To check if string is empty, you can also use:
aHodnota.Trim = Convert.ToString(DBNULL.Value)


Hi @ClaytonM,

thanks for your advance… :slight_smile: Just “” I tried before, but my robot still didn’t work.

I’m sorry, but I don’t know what to do next.


Since it’s a Generic Value you need a .ToString

aHodnota.ToString.Trim = ""
aHodnota.ToString.Trim = Convert.ToString(DBNULL.Value)


If anyone know how to solve this. as I got the same problem.


I tried to read from excel. phone number
if the colume phone got number (set as generic variable), paste the variable to the container in aother app.
otherwise go to next container for example email…

it give me error


many thanks



The “Object reference not set…” error means your variable used, phone, has no value stored in it. So I’m guessing that the Read Cell to store a value in phone did not execute. We would need to see how you are storing the phone variable before the If activity.

Alternatively, you can store the default value of the phone variable in the variable section. Just put “” in the default value in variables. That way, even if nothing gets stored to the variable it will have an empty string



thank you
I find another topic which is similar and it works now.