How to set the 2000 as max Character length to Justification field in change form in service now.

Srikanth Vadlam
Tera Contributor

I have a requirement to set a Justification field from change form with max Character limit of 2000. here I was facing a problem. initially it was set to 4000 characters length If I change it to 2000 It was troughing an error like there are certain N number of records which has more than 2000 no of characters. 

 

The Major challenge is when I go and check the variable in config dictionary max length is set to be 4000 but as a string variable It should need to limit to 4000 characters only, but it was taking without a limit as shown in the image

SrikanthVadlam_0-1670223463140.png

Justification field in the image

SrikanthVadlam_1-1670223534603.png

Config dictionary

SrikanthVadlam_2-1670223602206.png

there are no dictionary overrides also but still it is accepting a more than the condition.

 

2 REPLIES 2

mdash
Giga Guru

Hello Srikanth,

Here is the official response why this is expected behavior:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0685779#:~:text=Any%20string%....

And here is the workaround for that.

https://www.servicenow.com/community/developer-forum/how-to-restrict-character-limit-of-a-string-fie...

You can mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards

@Srikanth Vadlam 
Did the above work for you?

You can mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards