Convert to date time

Hi, im new to this community so the problem here is my data here have some items that have an expiry date and some doesn’t. So i decided to create a code such as for each → if currentrow.itemarray(3).tostring is Nothing → then it will have a log message says “no expiry” → else it will modify date as shown in the picture imageimage
but there is an error stating “Modify Date: String was not recognized as a Valid Datetime” i have this feeling that it is referring to the face shields that have no date.
This is for a clearer view.

I would change your condition


Let me know if this helps.


1 Like


This is FYI.

In UiPath (, Nothing (so called null )is not same as String.Empty (This means "").

Probably,the following expression will work as you expect.

CurrentRow(3) is Nothing OrElse String.IsNullOrEmpty(CurrentRow(3).ToString())

@Brandon_Cunningham 's way will be better because it can also exclude not only String.Empty but also invalid datetime string in advance, unless the value is Nothing.


1 Like

Hi @Brandon_Cunningham it works fine now really appreciated.