Write a client script using GlideUser API to set default field values based on user preferences.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 07:05 AM
I am new to servicenow. Can anybody please tell what is expected in question - Write a client script using GlideUser API to set default field values based on user preferences. and any hint for it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 07:10 AM - edited 05-23-2024 07:14 AM
Hi,
Kindly refer the following URL.
https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/client/c_GlideUserAPI
Using the GlideUser API you will be able to access the current user and current user roles.
For eg, In the client script you may use the following methods to retrieve the values.
g_user.userID ---- to retrieve the current logged in user's user id - Where you will be able to set the user automatically to the user field as the default value.
Thanks!
Ramkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 07:14 AM
Thanks Ramkumar. Yes i am able to use GlideUser API but not getting what is expected in " set default field values based on user preferences" ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 07:22 AM
Hi
What you need exactly to access from the user preferences. is it the language ?
Thanks!
Ramkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 07:28 AM
Anything will do . The question is "Write a client script using GlideUser API to set default field values based on user preferences." so it can be for any value