Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2023 07:54 PM
Hi,
I want to update the caller's field ('email') of the incident through the client script only.
I appreciate your help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2023 08:16 PM - edited 08-26-2023 08:17 PM
Hello @abdullahsardar9
Can You explain your Complete Use case here, so that I can help you,
because Caller is Reference Field on Incident Form. it refers to Data from sys_user Table
Thanks and Regards
Gaurav Shirsat

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2023 08:27 PM
Hello @abdullahsardar9
Try this sample code,
function onChange(control, oldValue, newValue, isLoading, isTemplate) { if (isLoading || newValue === '') { return; } var user = g_form.getReference('name', userDetails); function userDetails(user) { alert(user.email); g_form.setValue('email', user.email); } }

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2023 09:56 PM
Hi there,
Why would you like to update the callers field through a client script? Sounds a bit weird. Can you explain your case? And also WHEN this should happen. For example on load of a form could become a horrible user experience. So should this we onchange of a certain action perhaps?
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field