Can I use gs.info in a Client Script?

kishorchika
Tera Contributor

Can I use gs.info in a Client Script?

9 REPLIES 9

Dr Atul - LNG
Tera Patron

Hi @kishorchika 

No, mate — you can't use gs.info() in a Client Script. It's server-side only.

Hi @kishorchika 
-----------------------

gs.log() is also a server-side API.

Alternatively you can use

  • console.log(): 
    This is the standard JavaScript function for logging messages to the browser's developer console. This is the recommended method for client-side debugging.
  • jslog(): 
    This ServiceNow-specific client-side function also writes messages to the browser's developer console.
  • alert(): 
    While not ideal for debugging due to its intrusive nature, it can be used to quickly display messages in a pop-up window.

Sheldon  Swift
ServiceNow Employee

Hi @kishorchika - No, gs.info() is a server-side API.

pranita-24
Tera Guru

Hi ,

No you cant use gs.info in client script .
Use gs.log() or console.log()