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

Hi,


Its not clear whether the field length of the fields in the staging table is increased. If its not, increase the field length on the staging table , so the data is captured in staging table and later transformed into the actual tables.


Increase field length in the table u_imported_widgets.


My apologies - I'm not being clear.



The staging table(u_imported_widgets) field length is expanding automatically as needed to accommodate the largest field. This is normal and expected behavior from what I've ever experienced.


The target table (u_widgets) on the other hand is not honoring the Max Length setting and always truncating any value placed in the field to 40 chars.


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi gregory,



Thanks for the update. Can you manually change the field length for source table (u_imported_widgets) and check once.


Hi Pradeep,



Yes, I changed the size of the field in u_imported_widgets to 1000 and entered somewhere around 800 characters (and they did not truncate in the u_imported_widgets table - as expected). However, the target table is of course still truncating at 40.



Thanks,


Greg


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Try to cache the instance and check if this resolves your issue.