- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi All,
I want to make character length of a string field of at least 40 character . Is there any way configure it without scripting or we have to approach through script ?
Thank You
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
on string field in dictionary you can use max_length to allow max characters
but nothing OOTB is present for minimum length
you will require onChange client script for this.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @1_DipikaD,
You can set the maximum character length in the Dictionary for that field. However, if you also want to ensure the field contains at least 40 characters, you’ll need to add an onChange client script on field to enforce that.
----------------------------------------------------------------------------------------------------------------------------------------------
Please mark my response helpful and accept as solution
Thanks & Regards
Mayank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
It will be like mixture of onChanage and onSubmit client script . But not sure if it is fine to pursue or not .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
then either use onchange or onsubmit client script.
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You cannot enforce a minimum length constraint declaratively (OOB) for a String field, you’ll need to use scripting (for example, a Client Script onChange or onSubmit) to check value.length and throw an error or prevent submission if it’s below 40 characters....
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @1_DipikaD,
You can set the maximum character length in the Dictionary for that field. However, if you also want to ensure the field contains at least 40 characters, you’ll need to add an onChange client script on field to enforce that.
----------------------------------------------------------------------------------------------------------------------------------------------
Please mark my response helpful and accept as solution
Thanks & Regards
Mayank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @1_DipikaD,
You can accept multiple solutions as well, if my response was helpful, mark it as helpful or accept it as solution
Thanks & Regards
Mayank