Column table String type max length

christiandeange
Tera Contributor

Hi all,

I have a question about the max length of column of type string.

I created a new column and set the max length to 5000 but once I go to the form I can paste a string of 20000 character in the field. I save the record and the value doesn't trunc or modified.

The max length seems bugged or it is illimitate.

Can you explain me if it is normal and if does exist a real max length? I'm on an Helsinki instance.

Thanks.

Best Regards.

8 REPLIES 8

corina
ServiceNow Employee
ServiceNow Employee

Hello Christian.



I think the answer for your question is pretty much this one:


Max String Length


Hi Corina,



thanks for the answer. I readed the forum that you linked but I don't have the complete answer.


I understand that there isn't problem to the limit of the string if it is set bigger than 4K.


My problem is that if I set the limit to 5K and I insert a string with 20K characters this doesn't trunced.


My question is if this max length is stricted or it can be bypassed such in my case.




Regards.


Hello Christian.




This remark is indeed a kind of limitation we are aware of.


We know that the value is currently not enforced, therefore you should not even be prompted to have this option.



Trying 'glide.ui.textarea.character_counter' could help but it is not guaranteed.



To summarise this, you can take it as a limitation for the time being, your observation is correct.




You are correct. Once you get past a certain point (I thought it was 1000), then the large text field is pretty much unlimited. It will not truncate. That's because scripts, knowledge base articles content, and other variable length text is stored in the same underlying database field and we wouldn't want to truncate that, so when you create large string, it's basically available to hold any size string to avoid accidental truncation from shortsighted administrators.



FYI - underneath, MySQL only has a small number of field types. Most of what we store is in "string" fields. It isn't until you get to the ServiceNow platform that we expand on this for things like strings, choice lists, reference fields, etc.