- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 04:31 AM
In the sys_dictionary table, I've the following field:
But ServiceNow is allowing to store a value greater than 30 characters. For eg: It allowed to store a value of "Health and Safety - Customer responsibility" which is 43 characters long.
Is this expected?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 04:39 AM
Hi @Nisar3 ,
When you create a new sys_dictionary record to define a new string field, the max_length is mandatory. Despite the similarity of the name to HTML's maxlength attributes for input or textarea tags, this is not enforced as a limit in the client or server.
Max length is not enforced on the Now Platform
Fields in ServiceNow accept string inputs greater than the sys_dictionary max_length value. This is the expected behavior of the product.
When you create a string field in ServiceNow, the underlying column in the database is created with a default data type based in part on the specified max_length value:
- Small (40) = varchar(40)
- Medium (100) = varchar(100)
- Large (1000) = mediumtext
- Extra Large (4000) = mediumtext
Refer to below article for more details:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0685779
Sandeep Dutta
Please mark the answer correct & Helpful, if i could help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 05:01 AM
Hi @Nisar3 ,
We do not control database, since ServiceNow is a Saas Platform.
Sandeep Dutta
Please mark the answer correct & Helpful, if i could help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 05:54 AM
I understand we cannot control the database. But what I'm trying to figure out is if there is way to know what size would be set in the database if I use max length = 20 in sys_dictionary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 07:21 AM
HI @Nisar3 ,
As per my previous reply, if you use max length = 20 in sys_dictionary then it will be Small (40) = varchar(40).
Sandeep Dutta
Please mark the answer correct & Helpful, if i could help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 09:02 PM
Thanks Sandeep for that. I'm still a little confused though. How are you able to come to that conclusion? Is my understanding correct for the following screenshot
- If we specify anything less than 40 in dictionary, it will set to varchar(40) at database level
- Anything less than 100 (but greater than 40) in dictionary, it will set to varchar(100) at database level
- Anything less than 1000 (but greater than 100) in dictionary, it will set to mediumtext at database level and so on..
Is the assumption correct? I would not think so because I've set the value to 30 in dictionary but ServiceNow allowed 43 characters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 09:24 PM
Hi @Nisar3 ,
Yes, your assumption is correct.
Sandeep Dutta
Please mark the answer correct & Helpful, if i could help you.