
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 04:04 AM
According to This Docs Page, it's saying that gs.getUser().getPreference() returns a "String". It does not.
So in a widget, I have the following code in the Server Script part:
and this in my Client Script:
I have a user preference on the sys_user_preference table:
When I preview the widget, I get this in my console:
Now if I do something insanely ridiculous like this:
then fine, I get what I'm looking for.... however, I shouldn't have to do all this to when .getPreference() should be doing this for me.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 04:40 AM
If you're not in a scoped app, if you're creating that preference on your own profile try logging out then back in. The preference should then be applied.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 04:48 AM
Why would you think that gs.getUser().getPreference() can't be used in the "Global" scope?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 07:27 AM
docs.servicenow.com >> GlideUser shows method getPreference() for scoped but not for global,
but appears you are using it successfully, so are the docs incorrect?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 04:40 AM
If you're not in a scoped app, if you're creating that preference on your own profile try logging out then back in. The preference should then be applied.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 04:46 AM
Wow... that was it. It was a recently created preference. After logging out and then back in, everything worked.
So.... any way to set a user preference and have it available immediately without needing them to log out/in ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 05:41 AM
Nope, sorry don't know that one. Let me know if you find out though.