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 G- LNG
Tera Patron
Tera Patron

Hi @kishorchika 

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

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

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.
--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

Sheldon  Swift
ServiceNow Employee
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()