No "Changed" operator in UI Policy condition ?

Andy Pickles
Tera Contributor

Hi All,

Im really scratching my head here so please help .

Im trying to create a UI policy that will change the wok notes (internal) field on an incident form to mandatory if the assignment group changes.

We are trying to prevent the cold transferring of incident tickets.

 

However, in the "when to apply" section, there is no "Changes" operator that i can apply to the assignment group field.

I can compare it to itsself (Assignment group 'is different from' assignment group) but that doesnt work.

 

If I could get to the 'code' of the conditions somehow then i could add a VALCHANGES operator in there maybe ? But i cant seem to get to the code, only the drop down lists 😞

 

Could one of you experts please advise what would be the best way to achieve what i am looking to do ?

 

Apologies if its something simple .. Im not new to coding but im new to the ServiceNow platform and keen to learn.

 

Thanks in advance

1 ACCEPTED SOLUTION

Allen Andreas
Tera Patron

Hi,

The UI Policy runs on form load as well as when there's a change to the record (in client view).

For the assignment group field, as you've mentioned, there isn't a "changes" type operator, in the UI Policy settings (there is in business rules, though, just throwing that out there).

For this, you may need to use an onChange client script instead for the assignment group field and then set your field mandatory such as:

g_form.setMandatory('work_notes', true);

https://docs.servicenow.com/bundle/quebec-application-development/page/script/client-scripts/concept...

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

10 REPLIES 10

Wayne Richmond1
Tera Contributor

I've just discovered this, but unchecking 'On load' on the Advanced view form creates the same logic as "changes to". The documentation also seems to confirm this:

 

Option for specifying that the UI policy behavior should be performed OnLoad as well as when the form changes.

You can check or clear the On load check box in a UI policy to control whether it runs every time a form is loaded when the conditions are satisfied. In this example, an administrator does not want an incident to enter the Awaiting user info state unless the user provides an explanation to the customer. The administrator creates a UI policy with the following settings.
 
  • In the When to Apply section, adds the condition [State] [is] [Awaiting user info] and clears the On load check box. This condition means that the UI policy applies only when the state is changed to Awaiting user info.
  • In the UI Policy Actions related list, creates a record that makes the Additional comments field mandatory when the condition is met.

https://www.servicenow.com/docs/bundle/zurich-platform-administration/page/administer/form-administr...