- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
I have an issue I'd like to resolve and would appreciate your input. I created a custom field of type “choice” in the “cmdb_ci” table.
Since the strings for the options I want to add are long, I set the field's max length to 100, matching the “Label” field in sys_choice.
Additionally, I added choices exceeding 41 characters to sys_choice for cmdb_ci, setting both “Label” and “Value” to the same value. After adding the choices,
I discovered that when attempting to save a selection from the cmdb_ci list view for this custom field, any characters beyond the 41st position are truncated during saving.
We know this strange behavior does not occur if the “Value” registered in sys_choice is kept within 39 characters, allowing the entire string to be saved. However, we prefer to register the same string for both ‘Value’ and “Label” whenever possible.
Does anyone know a solution for this issue?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Sounds like a standard string where max length is set to 40.
Let's take the field "discovery_source" on [cmdb_ci_computer] as an example.
On the table it's a String field, max length 40.
However, it also has choices configured in [sys_choice].
I assume you're facing a similar situation - your base field on cmdb_ci has a Max length of 40, but the actual Value/Label fields in [sys_choice] does not (they're limited to 4000/100 I believe).
So, check your field length on cmdb_ci
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Sounds like a standard string where max length is set to 40.
Let's take the field "discovery_source" on [cmdb_ci_computer] as an example.
On the table it's a String field, max length 40.
However, it also has choices configured in [sys_choice].
I assume you're facing a similar situation - your base field on cmdb_ci has a Max length of 40, but the actual Value/Label fields in [sys_choice] does not (they're limited to 4000/100 I believe).
So, check your field length on cmdb_ci
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
please stick to OOTB field length.
I agree with what @MattiasJonsson shared.
💡 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
