Referencing the sys_user email address

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2011 11:48 AM
How would I create a reference variable that is referencing the email address from the sys_user field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2014 09:05 PM
Hi Jason,
I have the same question of pulling email address instead of name on referencing the field.
Can you let me know the solution?
Many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2014 11:40 PM
Hi Jason,
You can also use either a client script or catalog client script to update onLoad or onChange so long as you have a sys_user field like requested_for
Here is an example of an onLoad Catalog Client Script we have
function onLoad() {
if ('email' == '' && requested_for != '') {
g_form.setValue('email', '');
return;
}
if (!g_form.getControl('email'))
return;
var caller = g_form.getReference('requested_for', setEmail);
}
function setEmail(caller) {
if (caller)
//Get and then set the email address from the sys_user record
g_form.setValue('email', caller.email_address);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2014 12:23 AM
Thanks Gareth.
I tried to follow the referencing field from ServiceNow wiki for the same question, but it did not work as the wiki suggested.
Do you know if the referencing field deliver the same outcome?
If yes, can you let me know how in details?
Many thanks for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2014 12:42 AM
Hi Eddie,
can you add a screen shot of what you are trying to achieve.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2014 12:54 AM
Hi Gareth,
I want our user to select the Caller Name as the screenshot which will populate the Caller's email address in the Email field. With the option, user can either choose from the email suggestion or type-in manually.
I try to reference the Email field with the setting as the second screenshot. However, it does not work as I expect. One attempt, it shows the email suggestion with the caller name, when I select it, it only populate the caller name instead of email address.
Can you please help?
Many thanks