How to use gs.log in ui action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 03:09 AM
How to use gs.log() in ui action.I wanted to check if the state is changing to assess in the ui action please can anyone tell me how to check this
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 03:19 AM
Hi Deepika,
you cant - you can use console.log() or JSLog() [ServiceNow's logger for frontend] but not same as gs.log() [ which writes in the log]. As alternative you can try with an AJAX but I dont believe thats a good idea - too may DB hits for something you need only on the front end. Apart from that there is a way to check all Tomcat's activities by appending this to your ServiceNow's URL - https://your.sn_inastance.com/channel.do?sysparm_channel=logtail
But there is a way too much data in there if you ask me 🙂
Cheers,
Joro

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 03:25 AM
Hi,
use JSLog() for debugging in client scripts.
Mark the comment as a correct answer if this has answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 03:33 AM
Hi,
Your UI action is client script so gs.log() won't work
You can add alert statement to check the value
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2021 03:37 AM
Hope you are doing good.
Did my reply answer your question?
Would you mind marking the best matching answer as correct and helpful, to close this thread?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader