cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Null Row with in a given field (DateTime format)

vinodchinthakin
Level 9
Hi All.

I have a field which is DateTIme format and has some Null rows. I tried to use "Remove Null Rows" action from
"Utility Collection Manipulation" VBO but it throw's an error.

System.Data.EvaluateException: Type mismatch in function argument: Trim(), argument 1, expected System.String.

Can anyone suggest how to delete null rows from a DateTime field?



------------------------------
vinod chinthakindi
------------------------------
5 REPLIES 5

Carl__Carter
Staff
Staff
Hi Vinod,

You could use the 'Filter Collection' action in the 'Utility - Collection Manipulation' object to filter only rows which contain a date greater than the earliest possible date. For example, filter rows where the DateTime column value is greater than 1900-01-01 00:00:00. For example:

[DateTime Field Name] > #1900-01-01 00:00:00#

This would remove the rows containing NULL values in the DateTime column.

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

Thanks Carl. It worked!,. Just a heads up for others that above expression also works perfect for Date type column as well.

------------------------------
vinod chinthakindi
------------------------------

@Carl__Carter. Can you also suggest how to remove Null rows from a Flag type Field.​

------------------------------
vinod chinthakindi
------------------------------

Hi @Carl__Carter, Did you get a chance to look how to remove Null rows from a Flag type Field.​ and Number type Field.

------------------------------
vinod chinthakindi
------------------------------

Hi Vinod,

A Flag data item is aligned to the .NET Boolean data type, therefore it's value can only be equal to True or False.

If you pass a Flag data item into a Code Stage and the current value of this data item has not been set to True or False, then the Code Stage will default the value to False.

You can Loop the Collection outside of a Code Stage and text the length of the column value. If the value in the Collection has not been initialized, and therefore appears to be null, then the length would equal 0.

Len([CollectionName.FieldName]) = 0

You can then remove the row from the Collection using the Collections - Internal Business Object.



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