Uipath string null

Dan Atkins picture Dan Atkins · Apr 15, 2016 · Viewed 14k times · Source

Does anyone know how to check for an unassigned string in uipath? Uipath seems to crash when an if statement looks for a null string. Not sure how to handle that. String.empty doesn't seem to work, and if the string is unassigned uipath stops logging and nothing happens.

Answer

Aksh picture Aksh · Nov 18, 2016

There are many different approaches and ideas, but – according to me – what you can do is:

  1. Always make sure before to define any variable by default, initialize it with empty strings(""). So it will be easy to check it with equal operator as well.

  2. The Other approaches you can take in Uipath is based on .Net So u can use it's Is Nothing.

  3. You can also use .Net String.IsNullOrEmpty Method (String) Method.