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?

26 REPLIES 26

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
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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

 

Hi Rohith,

Sample example:

1) on incident form write UI policy when state changes to closed; make short description as mandatory from UI policy action

2) from UI policy script execute if true; use below script

g_form.setMandatory('short_description', false);

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
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

We got two differents answer. Which one is the right answer please? 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Rohith,

Can you also mark answer as correct if it helped so as to close the question? Thanks in advance

Regards

Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader