cancel
Showing results for 
Search instead for 
Did you mean: 

How to check if a DateTime data item is empty or not?

How to check if a DateTime data item is empty or not?

 I tried these 3 and its not working.

1. [My DateTime]<>""
2. Len([My DateTime])>0
3. Used Filter collection but that throws an error because it supports string only.

If I save "My DateTime" into a Text data item then it automatically saves value 1/1/0001 12:00:00 AM, while "My DateTime" is empty. Stange!!!

How does this work?

------------------------------
Thanks & Regards,
Tejaskumar Darji
Sr. RPA Consultant-Automation Developer
------------------------------
1 BEST ANSWER

Best Answers

Hi, Tejas you can do one workaround if the Datetime data item has value in it.

1.In a calculation stage, try to convert it into some date- for ex - dd-MM-yyyy
2, If it has the value, it will give a value in the output of the calculation stage, if not it will be empty.
3.If it's empty then your Datetime data item is also empty.

Hope this helps.
24616.png
24617.png

------------------------------
Murali
RPA Consultant
------------------------------

View answer in original post

3 REPLIES 3

Hi, Tejas you can do one workaround if the Datetime data item has value in it.

1.In a calculation stage, try to convert it into some date- for ex - dd-MM-yyyy
2, If it has the value, it will give a value in the output of the calculation stage, if not it will be empty.
3.If it's empty then your Datetime data item is also empty.

Hope this helps.
24616.png
24617.png

------------------------------
Murali
RPA Consultant
------------------------------

Carl__Carter
Staff
Staff
Hi Tejaskumar,

You can use the IsDateTime() function in a Decision or Calculation stage, to test if the data item contains a datetime value.

24618.png
24619.png
Hope this helps.

Cheers,

------------------------------
Carl Carter
Senior Developer
Blue Prism
Europe/London
------------------------------

Thanks, Murali & Carl. Both solutions are working very fine and as expected. Thanks for the quick help.

------------------------------
Thanks & Regards,
Tejaskumar Darji
Sr. RPA Consultant-Automation Developer
------------------------------