Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Advanced Condition "changes to"

xiaix
Tera Guru

Trying to convert this:

find_real_file.png

Into script.

Example:

find_real_file.png

I know that my .CHANGESTO is illegal, but It's to illustrate my point.

How can I get "changes to" into script?

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi David,



In a before or after business rule, you can use current.field.changesTo(value).



Example:



current.active.changesTo(false)


View solution in original post

8 REPLIES 8

Chuck Tomasi
Tera Patron

Hi David,



In a before or after business rule, you can use current.field.changesTo(value).



Example:



current.active.changesTo(false)


Chuck, it's a "Notification" on the Approval (sysapproval_approver) table.     Will your method still work?




find_real_file.png


Hi David,



Yes, it will work in a notification. I just tried it with one of mine.



answer = current.state.changesTo('new')


Thanks, Chuck!