What is the maximum fields we can have on a custom table form layout with out impacting performance.

Servicenow lear
Tera Contributor

Hi All,

I am working on a custom scoped APP which is extending the Task table and would like to know what are the limitations associated with number of fields one can have on the custom table and what are the impact on the user experience and performance ?

I have gone through this article :How many fields can I add? - Developer Community - Question - ServiceNow Community

Are there any latest guidelines for the same ? 

4 REPLIES 4

Hitoshi Ozawa
Giga Sage
Giga Sage

If adding many fields to forms, client performance probably would matter more than server performance.

Client performance will depend on end-users' computer specs as well as how many UI Policies and Client Scripts are executed on a form.

Also don't forget ServiceNow is a web application. This means sessions will timeout. Having too many fields on a form may result in session timing out before the form is filled.

I am still looking for any recommendations on latest field limitation

In my case, I'll limit number to less than 50 fields. This is mostly from client side performance issue instead of server performance issue.

As for the maximum number of fields, extended tables in ServiceNow tables like task is actually be a saved in a physical table "task" in a database instead of a separate table.

TPH - This table model was introduced in the Dublin release and applies only to the table hierarchy of the task table.there will be one physical db table that stores all classes in a given hierarchy. Currently, this is used on task table. This means, there is one physical database table, “task”, and all child classes of task are store on single physical task table.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0723580

There is a maximum size limitation on the row by the database.

The MySQL maximum row size limit of 65,535 bytes is demonstrated in the following InnoDB and MyISAM examples. The limit is enforced regardless of storage engine, even though the storage engine may be capable of supporting larger rows.

https://dev.mysql.com/doc/refman/8.0/en/column-count-limit.html#:~:text=The%20MySQL%20maximum%20row%...

The total bytes of all fields in a row therefore has to be less than the maximum size of a row.

AFAIK, ServiceNow by itself doesn't impose limitation so the maximum number of fields is going to depend on the size of fields.

FYI, String fields over 255 characters (no bytes) are saved as mediumtext.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0685779

In a database, text and blob fields are actually references so it only requires 9 or 12 bytes. So fields such as close_notes that has max length of 4,000 characters is counted not as 4,000 characters (12,000 bytes if multibyte characters with 3 bytes per character) but 9 or 12 bytes.

In the following MyISAM example, changing a column to TEXT avoids the 65,535-byte row size limit and permits the operation to succeed because BLOB and TEXT columns only contribute 9 to 12 bytes toward the row size.

Same goes for reference fields that actually saved sys_id of 32 bytes.