cancel
Showing results for 
Search instead for 
Did you mean: 

Can't compare unknown

VladimirGourov
Level 2
Hello,

Would anyone help me solve this issue? I am trying to set a range condition in BP process to throw an exception if the number is less than 1 or greater than 99. Under choice stage I input the following: [Data.Quantity]>99 OR [Data.Quantity]<1, while trying to validate the expression I get the message "Can't Compare Unknown".

Thanks.

------------------------------
Vladimir Gourov
------------------------------
6 REPLIES 6

KrishnaA
Staff
Staff
Hello Vladimir,

I just verified at my end.  The expression you specified is valid.  Please ensure "Data" collection has a column called "Quantity".   And the "Data" collection is exposed properly.

Best regards,
Krishna


------------------------------
Krishna A
Blue Prism
------------------------------
Krishna A [CompanyName]

RaúlHernández
Level 5
I think one of the variables has an undefined type. If this variables should be numbers, please verify the data type of both variables.

------------------------------
Raúl Hernández
RPA Developer
Millicom
America/El_Salvador
------------------------------

29542.png

Thanks everyone for your input. Yes, I have verified the column name and the data type, everything matches. The strange thing to me is that BP doesn't like the ">" and "<" signs for whatever reason. When I use "=" instead, then the expression is shown as valid.

29543.png


------------------------------
Vladimir Gourov
------------------------------

What data type is Data.Quantity?  If it is an unstructured collection, it is probably Text. You may have to covert it before comparing - ToNumber([Data.Quantity]) > 99

------------------------------
Tom Maloney
Architect
nBotix, Inc.
America/Chicago
------------------------------

​Thank you, that worked! Data.Quantity type is the number, but the error is gone finally!
29546.png


------------------------------
Vladimir Gourov
------------------------------

Glad that it worked.

The issue was: Since [Data] collection is a dynamic collection , it's columns don't have any fixed datatype. Hence all the data coming into it is automatically considered as TEXT.

Thus you need to convert the text to number before comparing.

------------------------------
Vivek Goel
RPA Architect
Asia/Singapore
https://www.rpatools.com/
"If you like this post, please press the "Recommend" Button.
------------------------------