
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2019 02:55 AM
Hello,
I am currently displaying the logged in user's first name in the portal using "gs.getUser().getFirstName();".
My first name 'shruthi' is displayed. When I am logged in, I go to my user record and change my first name as "Shruthij". After refreshing the portal homepage, gs.getUser().getFirstName() still shows "Shruthi". When I log out and log in again, it shows "Shruthij".
Why is this session dependent?
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2019 05:15 PM
getUser() returns a GlideMemoryRecord, which is loaded when you first log in.
If you want the real-time details, you'd need to either flush the cache (as mentioned above) or do a GlideRecord lookup
var grUser = new GlideRecord('sys_user');
grUser.get(gs.getUserID());
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2019 02:58 AM
Did you try to clean the cache of your browser?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2019 03:00 AM
Hi Rafael,
Thank you for your reply. Yes I did clear the cache. However, the behavior remained the same.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2019 03:00 AM
Try to clear Cache.
https://<instancename>.service-now.com/cache.do
Please mark my answer correct/helpful if it helps you solve your issue.
-Anurag

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2019 03:01 AM
Hi Anurag,
Thank you for your reply. Yes I did clear the cache. However, the behavior remained the same.
Thank you