Add a character limit on a variable from a record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2026 05:43 AM
Hello,
I would need to set a 350 words character limit on a variable from a record producer while filling in the form in the portal.
I found multiple solutions suggesting client scripts. Is there a way to fulfil this without scripting?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2026 06:07 AM
Hello @cloprea ,
Inside type specifications you can use validation regex for this use case. You can create your own regex and then use it where needed. Service Catalog > Catalog Variables > Variable Validation Regex
Check this support link:
https://www.servicenow.com/community/developer-articles/regexes-for-catalog-items-variable-validatio...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2026 06:08 AM
350 words is not a character limit. You can limit a variable to 350 (or whatever number) characters by using a Variable attribute: max_length=350
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2026 06:14 AM
if it's single line text variable then approach from @Brad Bowman will work
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2026 06:15 AM
Hi @cloprea,
You can use the variable attribute "max_length" to limit the number of characters, for example "max_length=200".
If my response helped, please mark it as the accepted solution so others can benefit as well.