Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Script type dictionary entry

MKhan1
Giga Contributor

Hi,

Has anybody used dictionary entry of "script" type. If yes, Please tell me how do i use this dictionary entry?. How can we execute the code written in this dictionary entry?.

7 REPLIES 7

Roger19
Tera Contributor

Hi JC,

great stuff! I hope the Evaluator does something like preventing infinite loops etc.?
I found somewhere in the code a with two additional parameters.

var e = new Packages.com.glide.script.Evaluator();
var answer = e.evaluateString('gs.getUserName()', '2', true);

Do you know their purpose?


Thanks James, I never really knew this! I was searching all over for this.


CapaJC
ServiceNow Employee
ServiceNow Employee

Evaluator won't do anything about loops. It just evaluates the String it's passed. Any loop would presumably be mitigated by transaction cancellation or transaction quotas (where a transaction isn't allowed to run more than a specific amount of time).

I don't know what those two lines are really meant to do, especially with those additional parameters.