When adding options longer than 41 characters, the text is truncated on the list screen.

hamauzutr13
Tera Contributor

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?

1 ACCEPTED SOLUTION

MattiasJonsson
ServiceNow Employee
ServiceNow Employee

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.

MattiasJonsson_1-1761741376645.png

 


However, it also has choices configured in [sys_choice].

 

MattiasJonsson_0-1761741351477.png

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

View solution in original post

2 REPLIES 2

MattiasJonsson
ServiceNow Employee
ServiceNow Employee

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.

MattiasJonsson_1-1761741376645.png

 


However, it also has choices configured in [sys_choice].

 

MattiasJonsson_0-1761741351477.png

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

Ankur Bawiskar
Tera Patron
Tera Patron

@hamauzutr13 

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! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader