UI Policy Documentation
UI Policy Documentation
Company Headquarters
2225 Lawson Lane
Santa Clara, CA 95054
United States
(408)501-8550
ServiceNow, the ServiceNow logo, Now, and other ServiceNow marks are trademarks and/or registered trademarks of ServiceNow, Inc., in the
United States and/or other countries. Other company and product names may be trademarks of the respective companies with which they are
associated.
Quebec Now Platform Administration
UI policies
UI policies dynamically change the behavior of information on a form and control
custom process flows for tasks.
For example, you can use UI policies to make the number field on a form read-only,
make the short description field mandatory, and hide other fields. Basic UI policies do
not require any scripting, however for more advanced actions, use the Run scripts
option.
You can also use client scripts to perform all of these actions, but for faster load times
use UI policies when possible.
Create a UI policy
A UI policy condition evaluates all fields even if they are not visible on the form. This
function removes the requirement that a field must be on a form for it to be evaluated.
Note:
• Policies carried over from versions prior to Fuji are evaluated differently. Fields that
previously were not evaluated are evaluated.
• UI Policies also apply to forms and lists displayed within Content Management
System application.
Procedure
2. Click New.
ServiceNow, the ServiceNow logo, Now, and other ServiceNow marks are trademarks and/or registered trademarks of ServiceNow, Inc., in the
United States and/or other countries. Other company and product names may be trademarks of the respective companies with which they are
associated.
Quebec Now Platform Administration
Field Description
When to Apply
ServiceNow, the ServiceNow logo, Now, and other ServiceNow marks are trademarks and/or registered trademarks of ServiceNow, Inc., in the
United States and/or other countries. Other company and product names may be trademarks of the respective companies with which they are
associated.
Quebec Now Platform Administration
Field Description
ServiceNow, the ServiceNow logo, Now, and other ServiceNow marks are trademarks and/or registered trademarks of ServiceNow, Inc., in the
United States and/or other countries. Other company and product names may be trademarks of the respective companies with which they are
associated.
Quebec Now Platform Administration
Field Description
creates a UI policy with the following
settings.
ServiceNow, the ServiceNow logo, Now, and other ServiceNow marks are trademarks and/or registered trademarks of ServiceNow, Inc., in the
United States and/or other countries. Other company and product names may be trademarks of the respective companies with which they are
associated.
Quebec Now Platform Administration
Field Description
UI policy runs. When the conditions
are met, the Urgency field is hidden.
Script
Other fields
ServiceNow, the ServiceNow logo, Now, and other ServiceNow marks are trademarks and/or registered trademarks of ServiceNow, Inc., in the
United States and/or other countries. Other company and product names may be trademarks of the respective companies with which they are
associated.
Quebec Now Platform Administration
Field Description
• Leave alone
• True
• False
• True
• False
• True
• False
Related Links
5. Click Submit.
Create a UI policy to implement controls in the Incident form when the state changes to
Resolved.
ServiceNow, the ServiceNow logo, Now, and other ServiceNow marks are trademarks and/or registered trademarks of ServiceNow, Inc., in the
United States and/or other countries. Other company and product names may be trademarks of the respective companies with which they are
associated.
Quebec Now Platform Administration
Procedure
2. Click New.
Name Input
Table Incident
4. Right-click the form header and select Save from the context menu.
The UI Policy Actions related list appears.
ServiceNow, the ServiceNow logo, Now, and other ServiceNow marks are trademarks and/or registered trademarks of ServiceNow, Inc., in the
United States and/or other countries. Other company and product names may be trademarks of the respective companies with which they are
associated.
Quebec Now Platform Administration
Name Input
Mandatory True
7. Click Submit.
8. Repeat the process to create UI policy actions to hide the Opened by field, and to
make the Priority, Severity, and Urgency fields read-only.
Any scripts you create for UI policies run on the client side.
You can use different options in the UI Policy form to control when and how the UI policy
is applied. These options include client scripts, OnLoad execution, and view-specific UI
policies. Administrators can use the UI Policy form to create client scripts that run
onChange when the UI policy conditions are met (Execute if true) or not met (Execute if
false).To display these scripting fields in the UI Policy form, in the Script section, select the
Run scripts check box.
For example, to display an alert to the user when the incident State field changes to
Resolved, create the following script in the Execute if true field.
function onCondition(){
alert('You changed the "Incident state" to Resolved. Please enter you
r comments in the "Close notes" field.');
}
Service catalog UI policies control the behavior of catalog item forms. Service catalog
UI policies can be applied to a catalog item or a variable set. For more information
about using UI policies for service catalog items, see Service catalog UI policy
ServiceNow, the ServiceNow logo, Now, and other ServiceNow marks are trademarks and/or registered trademarks of ServiceNow, Inc., in the
United States and/or other countries. Other company and product names may be trademarks of the respective companies with which they are
associated.