The CreatorCon Call for Content is officially open! Get started here.

Character limit is 1000 but still allowing more characters

Roopa11
Tera Expert

Hi All,

We have one text field 'Description ' in cmdb_ci_ip_address table but its allowing more characters in that field when CIs created through discovery.

 

Can you please help how to avoid it.

 

Thanks

Roopa

2 REPLIES 2

Najmuddin Mohd
Mega Sage

Hi @Roopa11 ,
Write a Before /Update Business rule on cmdb_ci_ip_address table.

if(current.description.length > 100){
  current.setAbortAction(true);
}


Or trim the Description to 100 Characters only.


If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.

Paul Kunze
Tera Guru

Hi, it is a known behavior of ServiceNow that a field stores up to 4000 characters if the max length of the field is set to something greater than 255.

This is based on the database architecture, see this support article for more details: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0685779

 

So for your case you could trim the input using a Business Rule like so:

current.description = current.description.substring(0, 1000);