Fields being truncated at 40 chars

gpopp
Kilo Expert

Hi!

I've created a table by importing a schema for it as a CSV file and using a transform map to add it to the sys_dictionary table. I did this because this table is being transferred from another database and has quite a few fields. Entering it by hand would be time consuming and error-prone.

An example of the entries in the csv file I used to create the table:

Table,Column name,Active,Type

u_widgets,Orders,true,String

u_widgets,Client Name,true,String

u_widgets,Thneed Count,true,String

etc.

The table created quite nicely. All strings created with the default 40 char size. There are roughly five fields that I needed to enlarge, so I modified by hand those fields' Max length to larger numbers such as 200.

Unfortunately, these fields are still quite locked at 40 chars. If I look at the form view for the table, the fields have large text entry boxes (apparently honoring the larger Max length) but when I try to add more than 40 chars, as soon as I save the entry it cuts off again back at 40.

Does anyone know what might be going on here? I've scanned the dictionary attributes for these fields and compared to more-than-40-char fields in other tables and I see no difference. Yet there must be a setting somewhere I've missed.

Any help would be vastly appreciated.

Thanks!

Greg

1 ACCEPTED SOLUTION

tony_barratt
ServiceNow Employee
ServiceNow Employee

Hi Gregory,



Try to change the max length to 256 first and then try to put it to a bigger value after.


It seems that if you don't put it to 256 first, the change will not occur at the database end (which you cannot change yourself).


As changing from 40 chars to say 400 requires a change to the field data type.


Introduction to Fields - ServiceNow Wiki



Best Regards



Tony


View solution in original post

20 REPLIES 20

on any import you are dealing with 2 tables.. .one <usually named _imp> holds the raw data prior to transform   the other the table you are using is the one you usually reference...



most of these issues are caused by someone updating the length on the target table... but leaving the default field size on the import table <where the raw data lives> you must make sure the field definitions on the two tables are identical.


tony_barratt
ServiceNow Employee
ServiceNow Employee

Hi Gregory,



Try to change the max length to 256 first and then try to put it to a bigger value after.


It seems that if you don't put it to 256 first, the change will not occur at the database end (which you cannot change yourself).


As changing from 40 chars to say 400 requires a change to the field data type.


Introduction to Fields - ServiceNow Wiki



Best Regards



Tony


Hi Tony,



Brilliant! Thank you SO much! This fixed the issue.


Man - Very unexpected behavior!



Thanks for the link to "Intro to Fields" as well. Most helpful!



Greg


Thank you, was racking my brain trying to figure out why my 8000 length field kept cutting off at 40 characters


Hi Greg\Anthony,



Am also facing the similar issue. I have initially created a String field of 100 character length and later I have updated to1000 characters. Though the field looks like a mulitiline text and allowing the user to enter upto 1000 character, while saving it was discarding the character and taking only upto 100 characters.



I have tried your suggestion to change the max_length to 256 and tried updating to 1000 however it is not working. Please let me know if you have any suggestion