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

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Gregory,



Check for this property "com.glide.loader.verify_target_field_size" in the below wiki link for more info.


http://wiki.servicenow.com/index.php?title=Available_System_Properties#gsc.tab=0


Thanks Pradeep!



That field is set to true in our instance so I'm afraid this is not the answer. I AM using import sets to load the data for this table, but really the only time import sets came into play here was when I added the fields to the table itself into the sys_dictionary. My imported data has no issues with these large fields. This table's fields get truncated at 40 even if I try to edit them by hand.


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Gregory,



Can you please confirm if you have also increased the field size in your source table.


Hi Pradeep,



I have increased the size (Max Length) in my TARGET table for a select number of fields yes.   In other words, I created the table by the usual means (table->new->etc) with no fields at all. I then uploaded the CSV schema I mentioned to create the numerous fields in this table (they all created as strings with size 40). Then I edited certain fields to enlarge their Max Length. For clarity and ease of reference, lets call this table u_widgets.



I have indeed imported DATA for this table into a staging table (lets call this u_imported_widgets). The data in this table has fields (the ones in question) with size much larger than 40 (377, 485, etc). I have a very straightforward transform map that moves the data from the staging table (u_imported_widgets) to the target table (u_widgets). Sadly, ALL my fields (even the ones that I have changed Max Length to be larger) truncate at 40. And again, even a hand edit of these fields in u_widgets results in truncation.



As an experiment I added a new string field to the table and gave it a length of 200 using the "insert a new row" method. This new field DOES NOT truncate at 40. So it seems only the fields that I auto-created using the schema import into sys_dictionary are having this problem. Clearly I'm missing a crucial step in this auto-field generation.



Regards,


Greg