Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Run UI Policy on every form change

Snow Tomcal
Tera Expert

Hi All,

I want to run a UI Policy every time that a change is made, is it possible?

Thanks in advanced 🙂

1 ACCEPTED SOLUTION

Hi @Snow Tomcal ,

 

Just turn it around as shown below. In my example, if category and sybcategory is not filed, then assignment group is read only:

 

UI Policy

AndersBGS_0-1686578342701.png

 

UI Policy Acotion:

AndersBGS_1-1686578384474.png

 

Incident (only one filed):

AndersBGS_2-1686578413556.png

 

Incident (both filled):

AndersBGS_3-1686578456492.png

 

if my answer has helped with your question, please mark as accepted solution and give a thumb up.

 

best regards

Anders 

 

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

View solution in original post

6 REPLIES 6

AndersBGS
Tera Patron
Tera Patron

Hi @Snow Tomcal ,

 

Yes - But I think the more important questions is, what is it that you would like to obtain by a UI Policy?

 

if my answer has helped with your question, please mark as accepted solution and give a thumb up.

 

best regards

Anders 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

How can I make this?

I'm trying to run an onChange script for multiple fields.

Hi @Snow Tomcal ,

 

A UI Policy might not be the way to go, if you would like to run a script on every incident etc. Why not utilize client script with an if condition to state of certain requirement is as defined? or run a Business rule instead? Again, what is it that you would like to obtain / what do you want to happen within the record? Your actual requirement is what that should define client script / Business rule / UI Policy etc.

 

if my answer has helped with your question, please mark as accepted solution and give a thumb up.

 

best regards

Anders 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

I want to make a field read only until another two fields are being filled.