<h2>Create a view rule</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 view rule" /><meta name="abstract" content="When a user switches views, the selected view is saved as a user preference so the user sees the same view by default when the form opens. With a view rule, you can override this functionality to force a specified view to be used." /><meta name="description" content="When a user switches views, the selected view is saved as a user preference so the user sees the same view by default when the form opens. With a view rule, you can override this functionality to force a specified view to be used." /><meta name="DC.relation" scheme="URI" content="../../../administer/navigation-and-ui/concept/view-management-overview.html" /><meta name="DC.relation" scheme="URI" content="../../../administer/navigation-and-ui/concept/c_NavigationAndTheUserInterface.html" /><meta name="DC.relation" scheme="URI" content="../../../administer/general/concept/configure-uis-and-portals.html" /><meta name="DC.relation" scheme="URI" content="../../../get-started/servicenow-overview/concept/working-in-ui16-and-ui15.html" /><meta name="DC.relation" scheme="URI" content="../../../administer/core-configuration/concept/p_NavigationAndUIConfiguration.html" /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2023-08-03" /><meta name="DC.date.modified" content="2024-02-01" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="t_CreateAViewRule" /><link rel="stylesheet" type="text/css" href="../../../CSS/commonltr.css" /><title>Create a view rule</title></head><body id="t_CreateAViewRule"> <div class="breadcrumb"><a class="link" href="../../../administer/navigation-and-ui/concept/c_NavigationAndTheUserInterface.html" title="Interact with ServiceNow AI Platform applications and data in the way that works best for you.">Configure user experiences</a> > <a class="link" href="../../../administer/general/concept/configure-uis-and-portals.html" title="Customize your interface to create an efficient, unique experience for users and customers.">Configure UIs and portals</a> > <a class="link" href="../../../get-started/servicenow-overview/concept/working-in-ui16-and-ui15.html" title="Learn about the features of the Core UI that predated Next Experience.">Working in Core UI</a> > <a class="link" href="../../../administer/core-configuration/concept/p_NavigationAndUIConfiguration.html" title="Change appearance, navigation menus, CSS, and utilize cutting edge interface tools.">User interface configuration</a> > </div> <h1 class="title topictitle1" id="ariaid-title1">Create a view rule</h1> <div class="body taskbody"><p class="shortdesc">When a user switches views, the selected view is saved as a user preference so the user sees the same view by default when the form opens. With a view rule, you can override this functionality to force a specified view to be used.</p> <div class="section prereq p"> <p class="p">Role required: admin</p> </div> <div class="section context"> <div class="p">View rules do not always apply if there are existing user preference entries on the instance. Delete the user preference entry and clear the system cache to make sure the respective view rule applies. You can clear the system cache by appending cache.do to the instance URL. For example, <span class="ph filepath">instance_name.service-now.com/cache.do</span>.<div class="note important"><span class="importanttitle">Important:</span> Clearing the system cache can affect overall performance, and degrade system response times. Do not run cache flushes during business hours, and do not trigger cache flushes automatically.</div> </div> </div> <ol class="ol steps"><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 UI</span> > <span class="ph uicontrol">View Rules</span></span>.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Click <span class="ph uicontrol">New</span>.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Complete the form, using the fields in the table.</span> <div class="itemgroup info"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="t_CreateAViewRule__table_ViewRule" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 1. </span>View rule form</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d257442e107">Field</th><th class="entry cellrowborder" style="vertical-align:top;" id="d257442e110">Input value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e107 ">Name</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e110 ">Specify an identifying name for the rule.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e107 ">Active</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e110 ">Select this option to apply the view rule according to the conditions you specified. If unchecked, the view rule is not be applied.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e107 ">Advanced</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e110 ">Select this option to specify a code-based condition instead of using the condition builder. Selecting this option displays the <span class="ph uicontrol">Script</span>field and hides the <span class="ph uicontrol">Match conditions</span>, <span class="ph uicontrol">Conditions</span>, and <span class="ph uicontrol">View</span> fields.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e107 ">Match Conditions</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e110 ">Select whether <span class="ph uicontrol">Any</span> or <span class="ph uicontrol">All</span> of the conditions need to be met. The system hides this field when you create an advanced View Rule.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e107 ">Conditions</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e110 ">Use the condition builder to determine when the view is applied. The system hides this field when you create an advanced View Rule.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e107 ">Application</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e110 ">Displays the application to which the View Rule record belongs.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e107 ">Table</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e110 ">Select the table on which this view rule will be applied. The list shows only tables and database views that are in the same scope as the view rule</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e107 ">Device type</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e110 ">Select which interface this view rule applies to.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e107 ">View</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e110 ">Enter the name of the View you are creating a rule for. The system hides this field when you create an advanced View Rule. This field is case-sensitive and must match exactly the view name.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e107 ">Script</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d257442e110 ">Enter a script to determine when to display a particular view. The system only displays this field when you create an advanced View Rule.</td></tr></tbody></table> </div> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Click <span class="ph uicontrol">Submit</span>.</span> </li></ol> </div> <div class="related-links"> <div class="familylinks"> <div class="parentlink"><strong>Parent Topic:</strong> <a class="link" href="../../../administer/navigation-and-ui/concept/view-management-overview.html" title="A view defines the elements that appear when a user opens a form or a list, and you can switch the view from the default for lists and forms.">View management</a></div> </div> </div></body></html></div>