- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2014 12:39 AM
Hi SN Guru's
Hope you can help with this request. Using the "getReference" call, I'm trying to take a users email address value (from the user referenced table) on the Change Request form and insert the email address value of a selected user straight into another field (new field) on the form using g_form.getReference method and object.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2014 08:03 PM
To verify, are you wanting to copy the email of the requested_by to the description when the requested_by is changed? Does this work for you, made a couple tweaks:
var refemail = g_form.getReference('requested_by', setDesc);
function setDesc(refemail) {
g_form.setValue('description', refemail.email);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2014 12:47 AM
Hi Orlando,
You can dotwalkin the reference field and get the email address of the user without any script.
You can refer the OOB client script If you want to "(BP) Set Location to User" to know more about the GetRef method.
Please let me know if you have any questions.
Thanks,
Pradeep Sharma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2014 12:49 AM
Please refer the below wiki link for further info on Dot-Walking
http://wiki.servicenow.com/index.php?title=Dot-Walking
NOTE:If you go by this way you need not use the scripting
Thanks,
Pradeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2014 12:51 AM
g_form.getReference('caller_id').user_email;
Once you have performed the "getReference", you have a glide record and can dot-walk it to the field values without further server lookups.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2014 01:00 AM
Hi Orlando,
Another thing you can do is, instead of creating a new field for email on the form, you can personalize your form layout and using this reference field to User table, you can perform a dot walk and add the email field from the user table itself on your form. This way, that field will be auto-populated, whenever you make an entry in the reference field, without any coding.
You can check section 3 in this link on how to do dot walking:-http://wiki.servicenow.com/index.php?title=Dot-Walking
Thanks & Regards,
Hari