When I write an expression, this writing is not allowed, because the left is an Integer and the right is a string. If it is used> <> = <= is not allowed, but I think the document is allowed.
Document Link: https://success.outsystems.com/documentation/11/reference/outsystems_language/logic/expressions/operators/
Thanks.
Hi @test test,
when writing expressions, it's essential to ensure that both sides of a comparison have the same data type. Comparing an Integer to a String directly will result in a type mismatch error. To resolve this, you should convert one of the values so that both sides of the comparison are of the same type.
For instance, if you're comparing an Integer to a String, you can use the TextToInteger() function to convert the String to an Integer before making the comparison.
For Example -123 > TextToInteger("123")
For more detailed information, please refer to the OutSystems documentation on handling unexpected data types:
https://success.outsystems.com/documentation/11/reference/errors_and_warnings/warnings/unexpected_data_type_warning/
Thanks,
Vipin Yadav
hi,
Thank you for your apply first
I can understand what you mean, but in the official document, I found that he has a concept of hidden conversion. And the document explains and supports the operation. For example, he will not report an error when he is 1 = "1", but he reports an error in the 1> "1", but in the document 1> "1" is clearly supported I don't know if this should be a bug
the document link:https://success.outsystems.com/documentation/11/reference/outsystems_language/logic/expressions/operators/
You can see Comparison Operators <,>, <=,> = part
I know you are talking about the Comparison Operators <,>, <=,> = part
OutSystems supports implicit (hidden) conversions for comparison operations in some cases, such as:
However, for relational operators like <, >, <=, >=:
This behavior is likely not a bug but an intentional design choice to enforce stricter type safety.
If you believe this inconsistency in behavior/documentation should be reviewed, you can raise this feedback with OutSystems Support to improve clarity.
Okay, I understand, thank you for your help
Thanks
Hi,
I don't think it mentioned clearly that it will convert implicit. "other operand is converted to text". It don't tell anything that it converts automatically or need to do conversion using built in functions.