- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 01:09 PM
Hi,
I have a form on which manager name is a reference type field referencing to User table. (sys_user)
There is another field called manager email address which is setup as string field. How to get email address of the selected manager into the email address field?
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 09:41 PM
Hi @swathivaddi
You can use getReference callback with an On-Change Client Script. Refer below screenshots:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.getReference('manager', getEmail); // Change the manager field name as per your catalog item
function getEmail(manager) {
g_form.setValue('email', manager.email); // Change the manager email field name as per your catalog item
}
}
Output :
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 11:15 PM
Hi @swathivaddi
Please have a look at this video for this fulfillment -
https://youtu.be/mQt4vaX19c8?si=LuIsvqlVnUX6x50H
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.
********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect
Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************