How do I find out if the Math.JS library functions are available within the SN instances i'm on?

JeraldP
Tera Contributor
 
1 REPLY 1

WORKFLOW-COWBOY
ServiceNow Employee
ServiceNow Employee

You can do things like this:

 

var x = 9;
gs.info('Square Root: ' + Math.sqrt(x)); // 3
gs.info('Power: ' + Math.pow(x, 2)); // 81
gs.info('Random Number: ' + Math.random()); // Random number between 0 and 1

 

Is that what you mean? You can run the code above as a Background Script and also try other functions to see if they work as you are expecting them to. 

 

--------------------------------------------------
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me. Thanks!
LinkedIn: https://www.linkedin.com/in/dalestubblefield/
YouTube: https://www.youtube.com/@starlordnow


--------------------------------------------------
Workflow Cowboy
LinkedIn: https://www.linkedin.com/in/dalestubblefield/
YouTube: https://www.youtube.com/@starlordnow