How to restrict user to enter only 9 Digits in UiPath App

How do you make the user enter only 9 digits in the text box, if the user enters less or greater than 9 digits then it should display a warning message below the text box in UiPath apps

@nisarga

Welcome to the community

In the text box properties you will have a regex pattern option where you can give \d{9}

Which would be validated

Cheers

@nisarga,

Please use mask features of text box control and put regex on mask as /d{9}/.

Mask features will strict user only to enter till 9 digit with above expression. But if you don’t use mask then you can enter n number of digit and this will throw error once you are :heavy_check_mark:

Here is mask features url

https://docs.uipath.com/apps/automation-suite/2023.10/user-guide/use-input-mask

Thanks, But when i use ? in mask char field , I’m not able to type anything inside the textbox…
And if I use only regex pattern the text box is taking spaces as input
image
Valid ID

Thanks, But can u suugest me how to restrict not to enter spaces …
UID

@nisarga

please try like this “/^\d{9}$/”

pattern field:
image

success:
image

failed
image

with only spaces
image

or with mask use like this(but better to use pattern as above)

image

cheers

Thank you , It works

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.