21
Views
5
Comments
The support of the expression is inconsistent with the documentation
Question


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.

2024-12-02 13-16-47
Vipin Yadav

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


UserImage.jpg
test test

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


Thanks, 

2024-12-02 13-16-47
Vipin Yadav

 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 <, >, <=, >=:

  • The platform requires both operands to be of the same data type explicitly.
  • Implicit conversion does not happen, and it will throw a type mismatch error.

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.

Thanks,

Vipin Yadav

UserImage.jpg
test test


Okay, I understand, thank you for your help

Thanks

UserImage.jpg
vikas sharma
Champion

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. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.