g_user object is not defined error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 10:12 PM
I am trying to get the current user name in my widget's client script, When I try to use 'g_user.firstName' I'm getting this error g_user not defined in the console.
Can anyone share a sample code to get the current username in client script.
Thanks in advance.
- Labels:
-
Service Portal
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2017 07:36 AM
This two links has good examples and explanation. May help you.
https://community.servicenow.com/message/756922#756922
https://community.servicenow.com/message/746632#746632
Thanks.
PS: Hit like, Helpful, Correct and Endorse, if it answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 10:08 PM
Hey Manikandan,
Maybe it's too late, Serviceportal provides an angular service to get information of the current user. Please check out this blog GlideUser/g_user in ServicePortal
Kindly mark correct/helpful if this has answered your question.
Thanks,
Sush