Book Image

Learning ServiceNow. - Second Edition

5 (1)
Book Image

Learning ServiceNow. - Second Edition

5 (1)

Overview of this book

This book is an updated version of Learning ServiceNow, that will cover the new and updated features of the ServiceNow platform. It will show you how to put important ServiceNow features to work in the real world, while introducing key concepts via examples of managing and automating IT services. It'll help you build a solid foundation of knowledge, and will demonstrate how to effectively implement and configure modules within ServiceNow. We'll show you how to configure and administer your instance, and then move on to building strong user interfaces and creating powerful workflows. We also cover other key elements of ServiceNow, such as notifications, security, reporting, and custom development. You will learn how to improve and automate your business' workflow and processes. By the end of this book, you will be able to successfully configure and manage ServiceNow like a pro.
Table of Contents (19 chapters)
Learning ServiceNow Second Edition
Contributors
Preface
Index

Scripting in UI policies


UI policy conditions are evaluated both on-load (if the On load tick-box is selected on the Advanced view) and whenever an update is made to any field on a form in ServiceNow. When an update is made, the condition on the UI policy is re-evaluated. If the condition returns true, then the UI policy actions run. If the conditions return false (and Reverse if false is enabled) then the opposite of the UI policy actions run. For example, if the UI policy turns a field mandatory under a certain condition, then when that condition is not met, it will typically explicitly set the field to non-mandatory.

Understanding that these events all happen within the browser (AKA the client) tells us that UI policies are therefore obviously evaluated client-side, which means that the client-side ServiceNow API is available. In the Advanced view of the UI policy form, there is a Script section. In this section, if the Run scripts tick-box is selected, two script input fields will be...