I have an input box (text) that has max length 13.
I then try to that that text and validate if its a integer. [ TextToIntegerValidate(text) ]
this does not seem to work as it only return false even if I only have numbers entered.

Divan van Kruiselbergen wrote:

I have an input box (text) that has max length 13.
I then try to that that text and validate if its a integer. [ TextToIntegerValidate(text) ]
this does not seem to work as it only return false even if I only have numbers entered.


The issue might be that your number is bigger than the C# Int 32 max value :  2147483647. It won't validate anything bigger than this, 


An alternate solution would be have a simple regex to validate it . 


Cheers.

Solution

You can also try TestToLongIntegerValidate() .. it supports a bigger range 

Solution

Hi Divan,

Alternatively, you could use the TextToLongIntegerValidate() function if your goal is to validate if only numbers were entered.

Regards,

Nordin


Hi Divan,


Like Tushar said, you can work with Regex. 

You can build an action that will be responsible to verify if the input is an integer. In that action you can use Regex_Search available in Outsystems by default. 

It´s available when you manage dependencies, under text.



That action will have a couple of inputs and outputs. But, basically you need to give your regex pattern and text, the output will say if it´s a match or not.

You can use this pattern to capture only integers    ^[0-9]*$


Best regards,

João Delgado