Script type field

dipesh1
Kilo Contributor

Hi All

In Snow, if   I make a custom table , and in that table if i make a "script" tyep field ,

the   value of script field   is like this

answer=Somefunction();

When is the script executed and what is the scope of variable "answer" ie where all can I Use it?

Any suggestions?

3 REPLIES 3

Mike Allen
Mega Sage

When the field is called, the script is run.  



For example, let's say you have a script field (called 'script_field') that has the script return an integer.   You can then write a business rule saying when script_field > 3.   It is then run when that business rule is run.


Hi Mike



As u said , I tried to find   some reference to "u_script" or the variable "answer" but couldn't find any , apart from




SomeFunction() defined in a script include. Any Idea what I am missing?   and does it mean the script is not executed at all?


It's not just answer.   You can return whatever you want it to return.



https://community.servicenow.com/thread/173066