Ui Policy action vs script

Sunny Gurung
Mega Contributor
  1. Which one of the following is true?
  1. A UI Policy’s Scripts execute before the UI Policy’s Actions
  2. A UI Policy’s Actions execute before the UI Policy’s Scripts
  3. A UI Policy’s Actions and Scripts execute at the same time
  4. The execution order for a UI Policy’s Scripts and Actions is determined at runtime
1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

I believe it is A UI Policy’s Scripts execute before the UI Policy’s Actions just like Sanjiv mentioned. I can't find any documentation on this on for example Docs. Though, if you would just test this in a PDI, then you would be able to confirm it is the correct answer.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

7 REPLIES 7

Martin Ivanov
Giga Sage
Giga Sage

@Mark Roethof @Allen Andreas , Are you sure about your answers to this thread?
I did some my testing with the following UI Policy

MartinIvanov_0-1665587112954.png

 


and the results say the oposite:

MartinIvanov_1-1665587121177.png

 


Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024

Hi,

What version of ServiceNow are you doing that test on? Our posts were back in 2019 and at that time, the script section did run beforehand. There's another thread where I even posted information, exact script(s) and screenshots, but I can't find it off right away.

 

With that said, ServiceNow could have adjusted the timing. I'd recommend running that a few times, just to see if you get the same result and try changing it up from setting a field read only, but perhaps mandatory and checking for asterisk.

 

-Allen


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

BiancaK
Tera Expert

As per the Scripting in ServiceNow Fundamentals eBook page 157 (Tokyo): "UI Policy Actions execute before UI Policy Scripts"

BiancaK_0-1694285357447.png