Write a client script using GlideUser API to set default field values based on user preferences.

SK00335601
Tera Contributor

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?

9 REPLIES 9

Ramkumar Thanga
Mega Sage

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

SK00335601
Tera Contributor

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" ?

Ramkumar Thanga
Mega Sage

Hi

What you need exactly  to access from the user preferences. is it the language ?

 

Thanks!
Ramkumar

SK00335601
Tera Contributor

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