Which executes first ,UI policy action or UI polic... - ServiceNow Community

Which executes first ,UI policy action or UI policy script?

Rohith16
Tera Contributor

When runnning ui policies ,which executes first ,whether UI policy action or UI policy script?

23 REPLIES 23

sachin_namjoshi
Kilo Patron
Kilo Patron

UI Policy scripts use the client-side API to execute script logic based on whether the UI Policy condition tests true or false. Use UI Policy scripts to create complex conditional checks or to take actions other than setting field attributes (mandatory, read-only, or visible).

The scripting fields for UI Policies are only visible in the Advanced view. To enable the scripting fields, select the Run scripts option.

  • The Execute if true script executes when the UI Policy condition tests true.
  • The Execute if false script executes when the UI Policy condition tests false.

 

Regards,

Sachin

AbhishekGardade
Giga Sage

Hello Rohith,

Execution order:

1. UI policy script

2. UI policy action

UI Policy scripts use the client-side API to execute script logic based on whether the UI Policy condition tests true or false. Use UI Policy scripts to create complex conditional checks or to take actions other than setting field attributes (mandatory, read-only, or visible).

The scripting fields for UI Policies are only visible in the Advanced view. To enable the scripting fields, select the Run scripts option.

  • The Execute if true script executes when the UI Policy condition tests true.
  • The Execute if false script executes when the UI Policy condition tests false.

Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade

Thank you,
Abhishek Gardade

Can you give me any idea ,how to test which executes first?

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Rohith,

UI policy has UI policy actions and also script when condition evaluates to true/false

so this is the order; try once

1) UI policy action first

2) UI policy script

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards
Ankur