<h2>Create a custom table</h2><br/><div style="overflow-x:auto"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta content="text/html; charset=UTF-8" /><meta name="copyright" content="(C) Copyright 2025" /><meta name="DC.rights.owner" content="(C) Copyright 2025" /><meta name="generator" content="DITA-OT" /><meta name="DC.type" content="task" /><meta name="DC.title" content="Create a custom table" /><meta name="abstract" content="Manage and store application data by creating a custom table, adding columns, and defining access controls." /><meta name="description" content="Manage and store application data by creating a custom table, adding columns, and defining access controls." /><meta name="DC.subject" content="applications, create a custom table, create a table" /><meta name="keywords" content="applications, create a custom table, create a table" /><meta name="DC.relation" scheme="URI" content="../../../administer/table-administration/concept/using-table-administration.html" /><meta name="DC.relation" scheme="URI" content="../../../build/custom-application/concept/build-applications.html" /><meta name="DC.relation" scheme="URI" content="../../../build/custom-application/concept/planning-applications.html" /><meta name="DC.relation" scheme="URI" content="../../../build/applications/reference/r_GlobalDefaultFields.html" /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2023-08-03" /><meta name="DC.date.modified" content="2024-08-01" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="t_CreateATable" /><link rel="stylesheet" type="text/css" href="../../../CSS/commonltr.css" /><title>Create a custom table</title></head><body id="t_CreateATable"> <div class="breadcrumb"><a class="link" href="../../../build/custom-application/concept/build-applications.html" title="Learn how to become an application developer using ServiceNow AI Platform low-code tools. Start with what you know and use a library of reusable components and published applications to modernize your legacy processes.">Building applications</a> > <a class="link" href="../../../build/custom-application/concept/planning-applications.html" title="The application development process starts with planning. Consider how the application will work, who will use it, and how it improves user experience.">Planning your application</a> > </div> <h1 class="title topictitle1" id="ariaid-title1">Create a custom table</h1> <div class="body taskbody"><p class="shortdesc">Manage and store application data by creating a custom table, adding columns, and defining access controls.</p> <div class="section prereq p"> <p class="p">Role required: admin</p> <p class="p">Check your custom table entitlements before creating custom tables. See <span class="xref"></span>.</p> </div> <div class="section context" id="t_CreateATable__context_dfs_wsc_4hb"> <div class="note"><span class="notetitle">Note:</span> To minimize the existence of unneeded and extraneous tables in an instance, don't overdo table creation. Create only those tables you need to minimize administration tasks and shorten upgrade times. If possible, create tables when building applications with tools. To learn more, see <a class="xref" href="../../../build/custom-application/concept/build-applications.html" title="Learn how to become an application developer using ServiceNow AI Platform low-code tools. Start with what you know and use a library of reusable components and published applications to modernize your legacy processes.">Building applications</a>.</div> </div> <ol class="ol steps" id="t_CreateATable__steps_gcm_ns2_xt"><li class="li step stepexpand"> <span class="ph cmd">Navigate to <span class="ph menucascade"><span class="ph uicontrol">All</span> > <span class="ph uicontrol">System Definition</span> > <span class="ph uicontrol">Tables</span></span>.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Select <span class="ph uicontrol">New</span>.</span> </li><li class="li step stepexpand"> <span class="ph cmd">On the form, fill in the fields.</span> <div class="itemgroup info"> <div class="p"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="t_CreateATable__table_yxx_ndv_tr" class="table" frame="border" border="1" rules="all"><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d203601e129">Control</th><th class="entry cellrowborder" style="vertical-align:top;" id="d203601e132">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e129 ">Label</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e132 ">Enter a unique label for the table (such as <span class="ph uicontrol">Laptops</span> or <span class="ph uicontrol">Thin Clients</span>). The label appears on list and form views for the table. Updating the <span class="ph uicontrol">Label</span> field also updates the label record in the language file for the current language. See Field Labels in <a class="xref" href="../../managing-data/concept/c_DataDictionaryTables.html" title="Access details related to tables, columns, and field labels in your instance.">Data dictionary tables</a>.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e129 ">Name</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e132 "> <div class="p">Edit the table name, which is automatically populated based on the table label and a prefix as follows:<ul class="ul" id="t_CreateATable__ul_mfm_l2v_tr"><li class="li">For a table in a scoped application, the name is prefixed with a namespace identifier to indicate that it is part of an application.</li><li class="li">For a table in the global application, the name is prefixed with the string <span class="keyword apiname">u_</span>.</li><li class="li">For a remote table in a scoped application, the name is prefixed with a namespace identifier and the string <span class="keyword apiname">st_</span> to indicate that it is remote and part of an application.</li><li class="li">For a remote table in the global application, the name is prefixed with the string <span class="keyword apiname">u_st_</span>.</li></ul> </div> <p class="p">You cannot modify the prefix; however, you can modify the rest of the table name. The name can contain only lowercase, alphanumeric ASCII characters and underscores (_).</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e129 ">Extends Table</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e132 "> <p class="p">Select the table to extend. <span class="ph" id="t_CreateATable__table-extension">Extending a base table incorporates all the fields of the original table and creates system fields for the new table. If they are in the same scope or if they can be configured from other scopes, you can extend tables that are marked as extensible.</span></p> <div class="note important"><span class="importanttitle">Important:</span> Don't extend the [sys_choice] table. Extending the [sys_choice] table is not supported.</div> <p class="p">The Extends Table option is not available if you select the <span class="ph uicontrol">Scriptable Table</span> check box to designate that this table is scriptable.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e129 ">Application</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e132 ">[Read only] Displays the application associated with this table. If you are working on an application or are creating a table from an application record, the field defaults to that application. Otherwise, the field defaults to <span class="ph uicontrol">Global</span>. Any records that are created from the table record, such as modules and security rules, are assigned to this application by default.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e129 ">Remote Table</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e132 "><span class="ph">Option to designate this table as a remote table. A remote table is a table to which you can associate a script definition for retrieval of data from an external data source. Unlike a standard internal table, the data does not come from records in the current instance.</span> <p class="p">If you select this check box, you cannot access the <span class="ph uicontrol">Extends Table</span> option because scriptable tables cannot be extended from other tables.</p> <div class="note"><span class="notetitle">Note:</span> To learn more about scriptable tables, see:<ul class="ul" id="t_CreateATable__ul_ny3_3sx_lhb"><li class="li"><a class="xref" href="../administer/remote-tables/concept/remote-tables.html" target="_blank" rel="noopener noreferrer">Retrieving and caching external data using remote tables</a></li><li class="li"><a class="xref" href="../administer/remote-tables/task/create-remote-table.html" target="_blank" rel="noopener noreferrer">Create a remote table</a></li><li class="li"><a class="xref" href="../administer/remote-tables/task/create-remote-table-script.html" target="_blank" rel="noopener noreferrer">Create a script definition for a remote table</a></li></ul> </div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e129 ">Create module</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e132 "> <p class="p">Select the check box and then complete the <span class="ph uicontrol">Add module to menu</span> field to create a list module in the application menu.</p> <p class="p">This option is available only when creating a table.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e129 ">Add module to menu</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e132 ">Select an existing menu or select <span class="ph uicontrol">Create new</span> and enter a new menu name. This option is available only when the <span class="ph uicontrol">Create module</span> check box is selected.</td></tr></tbody></table> </div> </div> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Add columns to the table using the <span class="ph uicontrol">Table Columns</span> embedded list in the <span class="ph uicontrol">Columns</span> section.</span> <div class="itemgroup info"> <div class="p"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="t_CreateATable__table_myw_mmy_wt" class="table" frame="border" border="1" rules="all"><colgroup><col style="width:50%" /><col style="width:50%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d203601e340">Column</th><th class="entry cellrowborder" style="vertical-align:top;" id="d203601e343">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e340 ">Column label</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e343 "> <p class="p">Define a unique label for the column. The label appears on list headers and form fields for the column. When you update the <span class="ph uicontrol">Column label</span> field, the system also updates the label in the language file for the current language.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e340 ">Type</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e343 ">[Mandatory] Define the field type for the column. See <a class="xref" href="../administer/reference-pages/concept/c_IntroductionToFields.html" target="_blank" rel="noopener noreferrer">Field administration</a> and <a class="xref" href="../administer/reference-pages/reference/r_FieldTypes.html" target="_blank" rel="noopener noreferrer">Field types</a>. To preserve existing data, only change fields between the same basic type (for example, <span class="ph uicontrol">Choice</span> and <span class="ph uicontrol">String</span>). A warning appears if a change to a custom field results in data loss. You cannot change a base system field, that results in data loss.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e340 ">Reference</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e343 "> <p class="p">Make the field into a <a class="xref" href="../administer/field-administration/concept/c_ReferenceField.html" target="_blank" rel="noopener noreferrer">Reference field type</a> by entering the referenced table name.</p> <div class="p"> <div class="note"><span class="notetitle">Note:</span> Dynamic reference creation is enabled for this field. So, if you enter a table name that does not match an existing table, a new table is created when you save changes to the current table record. If the current table has a module in the application navigator, then a module for the newly created table is automatically created in the same application menu.</div> </div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e340 ">Max length</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e343 "> <p class="p">[String fields only] Limit the length of the field. A length of under 254 appears as a single-line text field. Anything 255 characters or over appears as a multi-line text box.</p> <div class="note"><span class="notetitle">Note:</span> <ul class="ul" id="t_CreateATable__ul_rql_smy_wt"><li class="li">You can only change this value if the <span class="ph uicontrol">Type</span> of the field is <span class="ph uicontrol">String</span>. Changes for any other type of field are ignored.</li><li class="li">On an Oracle instance, you cannot increase the maximum length of a string field to greater than 4000 because it requires the CLOB datatype in Oracle. To increase beyond this size, log an incident with <span class="ph">ServiceNow</span> Technical Support to request the change.</li><li class="li">To prevent data from being lost, only decrease the length of a string field when you are developing a new application and not when a field contains data. A warning appears if a change to a custom field results in data loss. For a base system field, you cannot make a change that results in data loss.</li></ul> </div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e340 ">Default value</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e343 ">Specify the default value of the field for any new record. Ensure that this value uses the correct field type. For example, an integer field can use a default value of <span class="keyword option">2</span> but cannot use a default value of <span class="keyword option">two</span>. These values can be overridden with <a class="xref" href="../../data-dictionary-tables/concept/c_DictionaryOverrides.html" title="Dictionary overrides provide the ability to define a field on an extended table differently from the field on the parent table.">dictionary overrides</a>.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e340 ">Display</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e343 "> <p class="p">Indicate whether this field is the <a class="xref" href="../administer/field-administration/concept/c_DisplayValues.html" target="_blank" rel="noopener noreferrer">Display values</a> (appears on records that reference this table).</p> <div class="p"> <div class="note"><span class="notetitle">Note:</span> This option does not control whether this field is displayed on lists or forms.</div> </div> </td></tr></tbody></table> </div> </div> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Define additional table options in the <span class="ph uicontrol">Controls</span> section.</span> <div class="itemgroup info"> <div class="p"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="t_CreateATable__table_rrd_xmy_wt" class="table" frame="border" border="1" rules="all"><colgroup><col style="width:50%" /><col style="width:50%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d203601e521">Control</th><th class="entry cellrowborder" style="vertical-align:top;" id="d203601e524">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e521 ">Extensible</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e524 ">Select the check box to enable other tables to extend this table. Clear the check box to prevent the creation of additional child tables; existing child tables remain unchanged.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e521 ">Live feed</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e524 ">Select the check box to enable record feeds for the table. This option adds the <span class="ph uicontrol">Show Live Feed</span> icon (<img class="image icon" id="t_CreateATable__image_zlr_zmy_wt" src="../image/LiveCompanyFeed.png" alt="Show Live Feed icon" />) in the form header.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e521 ">Auto-number</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e524 ">Select the check box, and then define the number format to add an auto-numbered field to the table. The check box is available only when a number format does not exist for the table. Otherwise, you can edit the existing number format.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e521 ">Create access controls</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e524 ">Select the check box and then complete the <span class="ph uicontrol">User role</span> field to create basic security rules for the table.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e521 ">User role</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e524 ">Enter a new name or select an existing user role that is required to access this table. This option is available only when the <span class="ph uicontrol">Create access controls</span> check box is selected.</td></tr></tbody></table> </div> </div> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Define the scope protection for the table in the <span class="ph uicontrol">Application Access</span> section.</span> <div class="itemgroup info">For more information, see <a class="xref" href="../../../build/applications/concept/c_ApplicationAccessSettings.html" title="Application access settings determine whether one application can access resources from another application.">Application access settings</a>.<div class="p"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="t_CreateATable__table_xwp_pny_wt" class="table" frame="border" border="1" rules="all"><colgroup><col style="width:50%" /><col style="width:50%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d203601e629">Control</th><th class="entry cellrowborder" style="vertical-align:top;" id="d203601e632">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e629 ">Accessible from</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e632 "> <div class="p">Specify which application scopes can access the table:<dl class="dl" id="t_CreateATable__AccessibleFrom"> <dt class="dt dlterm">All application scopes</dt> <dd class="dd">Can be accessed from any application scope.</dd> <dt class="dt dlterm">This application scope only</dt> <dd class="dd">Can be accessed only from the current application scope.</dd> </dl> </div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e629 ">Can read</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e632 ">Select the check box to enable script objects from other application scopes to read records stored in this table. This option offers runtime protection. For example, a script in another application can query data on this table. First select read access to grant any other API record operation.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e629 ">Can create</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e632 "> <p class="p">Select the check box to enable script objects from other application scopes to create records in this table. This option offers runtime protection. For example, a script in another application can insert a new record in this table. This option is available only when the <span class="ph uicontrol">Can read</span> check box is selected.</p> <p class="p">Clear the check box to prevent script objects from other application scopes from creating records in this table.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e629 ">Can update</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e632 "> <p class="p">Select the check box to enable script objects from other application scopes to modify records stored in this table. This option offers runtime protection. For example, a script in another application can modify a field value on this table. This option is available only when the <span class="ph uicontrol">Can read</span> check box is selected.</p> <p class="p">Clear the check box to prevent script objects from other application scopes from modifying data stored in this table.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e629 ">Can delete</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e632 "> <p class="p">Select the check box to enable script objects from other application scopes to delete records from this table. This option offers runtime protection. For example, a script in another application can remove a record from this table. This option is available only when the <span class="ph uicontrol">Can read</span> check box is selected.</p> <p class="p">Clear the check box to prevent script objects from other application scopes from deleting records from this table.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e629 ">Allow access to this table via web services</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e632 "> <p class="p">Select the check box to enable users to make inbound <a class="xref" href="../integrate/web-services/reference/r_AvailableWebServices.html" target="_blank" rel="noopener noreferrer">Web services</a> web service queries to this table. This option offers both design-time and runtime protection. The user performing the query must have the correct permissions to access this table, even when this check box is selected.</p> <p class="p">Clear the check box to prevent users from making web service queries to this table.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e629 ">Allow configuration</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d203601e632 "> <p class="p">Select the check box to enable applications from other application scopes to create configuration records for this table that change its functionality. For example, an application designer can select this table from the <span class="ph uicontrol">Tables</span> list on business rules, client scripts, or UI actions. This option offers design-time protection.</p> <p class="p">Clear the check box to prevent application designers from selecting this table when creating configuration records.</p> </td></tr></tbody></table> </div> </div> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Click <span class="ph uicontrol">Submit</span>.</span> </li></ol> <div class="section postreq" id="t_CreateATable__postreq_bhm_j5w_ypb"> <div class="p">To change the field labels in your table or the label of the table itself, perform the following task: <ol class="ol" id="t_CreateATable__ol_cm1_k5w_ypb"><li class="li">Navigate to the Field Label [sys_documentation] table, and filter the table to show the table that has the fields you want to change. To find the label that represents the table itself, filter the records where <span class="ph uicontrol">Element</span> is empty.</li><li class="li">Open the field record that you want to change, and make your updates. For a description of each field, see <a class="xref" href="../administer/localization/reference/r_FieldLabelTable.html" target="_blank" rel="noopener noreferrer">Field Label table</a>.</li></ol> </div> </div> </div> <div class="related-links"> <ul class="ullinks"><li class="link ulchildlink"><strong><a href="../../../build/applications/reference/r_GlobalDefaultFields.html">Global default fields</a></strong><br /> When you create a new custom table, several fields appear in the <span class="ph uicontrol">Table Columns</span> embedded list. For all tables, required system fields are added automatically. You cannot delete or modify these fields.</li></ul> <div class="familylinks"> <div class="parentlink"><strong>Parent Topic:</strong> <a class="link" href="../../../administer/table-administration/concept/using-table-administration.html" title="Administrators can modify the database structure using table administration tools.">Managing tables and indexes</a></div> </div> </div></body></html></div>