We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

I have a requirement in a Record Producer where I need to restrict a variable input to a maximum of

jeevanjadhav
Tera Contributor

Hi All,

I have a requirement in a Record Producer where I need to restrict a variable input to a maximum of 100 characters at the time of submission.

The user should not be able to submit the record if the entered value exceeds 100 characters. I would like to implement this validation on the Record Producer variable during submit.

Could you please suggest the best way to achieve this? Should this be done using a Catalog Client Script (onSubmit), UI Policy, or any out-of-the-box configuration?

Thanks in advance.

7 REPLIES 7

Ankur Bawiskar
Tera Patron

@jeevanjadhav 

no scripting required, follow what @Shruti  mentioned.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

abirakundu23
Giga Sage

Hi @jeevanjadhav ,

Step1 : You can follow the OOB steps and set the variable length to 100. However, after entering characters up to the defined limit, the system does not allow you to enter additional characters. No error message is displayed, and you can submit it.

abirakundu23_0-1770880799953.png

 

abirakundu23_1-1770880835220.png

Not allow enter further characters.



Step2 : You can create an “on submit” catalog client script that prevents form submission and displays an error message such as: “The variable input should not exceed a maximum of 100 characters.”

On Submit Catalog Client Script :

abirakundu23_0-1770883044504.png

 

abirakundu23_2-1770880948819.png

 


Please mark helpful and correct answer if its worthy for you.


Aditya_hublikar
Mega Sage

Hello @jeevanjadhav ,

 

@Shruti   already provided solution. Just follow that , that will  help you .

 

Regards,

Aditya