62
Views
15
Comments
Solved
If condition to check whether the length of value is 23 or less.

In logic what conditions should I give for If condition to get validation message if character is less than 23.
Currently I am giving the below condition and it is not working. If I enter value which is equal to 23 then also it is throwing error message.

Length(GetRepeatedCodes.List.Current.ServiceModel.ProductHierarchy) < 23

( Service Model is entity and Product Hierarchy is its attribute ).

Can you suggest me with proper validation condition in If ?

UserImage.jpg
Rajshree Singh

Thanks @ibox ! It worked. That validation document is really helpful.

2025-01-09 14-56-57
IQ78
2023-05-23 04-55-55
Wasimkhan Syed Abuthahir

Hi,

If you want to check it is less than or equal to 23. 

Then use, Length(GetRepeatedCodes.List.Current.ServiceModel.ProductHierarchy) < =23 

Also Can you upload the text here which you are getting in "GetRepeatedCodes.List.Current.ServiceModel.ProductHierarchy"


Regards,

Wasimkhan S

UserImage.jpg
Rajshree Singh

It is not giving back any text.

2023-05-23 04-55-55
Wasimkhan Syed Abuthahir

Can you share the screenshot of your code or an OML would be helpful to look into it

UserImage.jpg
Rajshree Singh

Due to security reasons I can't share my OML. Below is the attached screenshot of basic structure which I am approaching.

2025-09-04 06-33-37
Nikhil___Vijay

Hello Rajshree

have you this condition 

Length(GetStores.List.Current.Country.DialCode)<=23

For the entity "country", the attribute is "dial code". It only works if the number is greater than or equal to 23.

can you share the datatype of  Product Hierarchy  

Regards 

Nikhil kumar vijay

UserImage.jpg
Rajshree Singh

My condition is - 

Length(GetRepeatedCodes.List.Current.ServiceModel.ProductHierarchy) < 23

Requirement - It will throw error when length is less than 23 characters. If it is equal to 23 then it should accept the value.

Product Hierarchy is of Text data type.

2023-05-23 04-55-55
Wasimkhan Syed Abuthahir

Can you check the Branch you are navigating to the correct branch in If.

Regards,

Wasimkhan S

UserImage.jpg
Rajshree Singh

I am applying the same. If the length is less than 23, I am assigning validation message to it otherwise it is getting towards end.

This is the structure I am following.


2023-05-23 04-55-55
Wasimkhan Syed Abuthahir

Can you share the value you are passing.

If you want to show the validation message in front end. I think you need to Ajax refresh the widget.

https://success.outsystems.com/documentation/11/reference/outsystems_language/traditional_web/web_logic_tools/ajax_refresh/

Regards, Wasimkhan S

UserImage.jpg
Rajshree Singh


I am giving two assignments -

Value.Valid = False

Value.ValidationMessage = "Value must be of 23 characters"

2023-05-23 04-55-55
Wasimkhan Syed Abuthahir

Like this? Also can you debug it, in which flow it is going?


Regards,
Wasimkhan S

2025-01-09 14-56-57
IQ78
Solution
UserImage.jpg
Rajshree Singh

Thanks @ibox ! It worked. That validation document is really helpful.

2025-01-09 14-56-57
IQ78
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.