Any use case of 'Execute in sandbox' and 'execute as scriptlet' in scripts background?

Suggy
Giga Sage

We have 'Execute in sandbox' and 'execute as scriptlet' in scripts background. Are there any use cases of it? Any example scenarios of its usage?

Suggy_0-1736148927082.png

 

4 REPLIES 4

Mayur2109
Kilo Sage

Hi @Suggy ,

 

  • Execute in sandbox : Allows script to run with sandbox like restrictions. If checked, data cannot be inserted, updated, or deleted.
  • Execute as scriptlet : Allows the script to execute as a scriplet, which gives the script access to the global scope and any server-side functionality or objects. If the check box is not selected, the script executes in global scope, but does not have access to any server-side functionality or objects.

Please refer below docs for more understanding of this, you can relate your use case as per this documentation.

https://www.servicenow.com/docs/bundle/xanadu-api-reference/page/script/server-scripting/concept/c_S... 

https://developer.servicenow.com/blog.do?p=/post/training-scriptsbg/ 

 

Please check and Mark Helpful and Correct if it really helps you.

Regards,
Mayur Shardul

ServiceNow Rising Star 2024

I have already read that 🙂

That was not my question by the way 🙂

Matthew Fody
ServiceNow Employee
ServiceNow Employee

What exactly is your question?

Mayur's answer was the correct answer to what you were asking. Use sandbox when you want to prevent inserts / deletes / updates as a way of testing a script. Use scriptlet when you want server-side functionality.  Those are the use cases for those options.

For more info on server-side scripts see the following docs,
https://www.servicenow.com/docs/bundle/xanadu-api-reference/page/script/server-scripting/concept/c_S...

Suggy
Giga Sage

Anyone?