Get email, phone.... from current logged in user , does anybody know ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2013 05:18 AM
Hi all,
I spent some time to find how get data about logged in user and dont have luck.
I want get whatever exist on sys_user table from user record.
I can get it from form to state = current.assigned_to.email
But how do I get same info from logged in user ?
gs.getUser(); dont work for me
i tried gs.getUser().email; .......and not work
I need to use this in
Please help
Petr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2013 10:39 AM
gs.getUser().getID() function will give you the sys_id, so you can pass it on GlideRecord for sys_user table to get the required record.
Thanks
Srinivas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2013 09:05 PM
Hello,
thank you for your help here.
I have created finally script as a glideRecord query as I need to use it later somewhere, only not on Client.
My script is below. With this script I can get whatever I want from logegd in user from SYS_USER table,
Petr
var u = gs.getUserID(); // variable for logged in user
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id',u); // look for sys_is from logged in user
gr.query();
while (gr.next()) {
var answer = gr.u_personal_signature; // this is what I want to get from user table from logged in user
// do whatever you want do
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2013 04:21 AM
I'm glad the guru page helped. If you're getting user values server-side, there's a shortcut to all of the information that is explained there. Here's a code example for getting the user's title.
//This script gets the user's title
gs.getUser().getRecord().getValue('title');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2013 05:25 AM
Thanks, I have tried and it work perfect.
Petr