- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 02:47 PM
I am trying to Auto populate the email of Caller in a Email ID field by using Script include and client script, but only a pop is coming up with a "Null".
Client Script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:23 PM
Hi @Rishi9128,
Try changing:
ga.addParam('sysparm_callerid', 'callerdetails');
to:
ga.addParam('sysparm_callerid', callerdetails);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 06:44 PM
Hi Rishi,
You can refer to the below video where it has been explained to get Email ID of the Caller. As well as, use the same Script Include function to return phone number of the Caller.
To learn about basics of GlideAjax, refer to this video.
Please mark this comment as Helpful/Correct Answer if it helped you.
Cheers,
Hardit Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 07:22 PM - edited 09-27-2023 07:23 PM
I think you issue lies in this line
ga.addParam('sysparm_callerid', 'callerdetails');
its sending the string ‘caller details’ instead of the sys id, remove the ‘’ that should fix. Also add some logging to your script include to see what’s getting passed over
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 09:48 PM
Hi @Rishi9128
Just a suggestion...!!
You can get an email field of caller in incident by dot walking.
Configure the form layout and get Email id field by dot walking.
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:23 PM
Hi @Rishi9128,
Try changing:
ga.addParam('sysparm_callerid', 'callerdetails');
to:
ga.addParam('sysparm_callerid', callerdetails);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 06:44 PM
Hi Rishi,
You can refer to the below video where it has been explained to get Email ID of the Caller. As well as, use the same Script Include function to return phone number of the Caller.
To learn about basics of GlideAjax, refer to this video.
Please mark this comment as Helpful/Correct Answer if it helped you.
Cheers,
Hardit Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 07:22 PM - edited 09-27-2023 07:23 PM
I think you issue lies in this line
ga.addParam('sysparm_callerid', 'callerdetails');
its sending the string ‘caller details’ instead of the sys id, remove the ‘’ that should fix. Also add some logging to your script include to see what’s getting passed over
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 09:06 PM - edited 09-27-2023 09:14 PM
Hello @Rishi9128 ,
Actually, this is the Out-of-the-box feature, no need to write any code for it.
Just add the Caller.email field from the Form layout
1. Right-click the form header to open the form context menu, select configure -> Form layout, Select Caller[+] from the available bucket, and double-click on it, to expand caller fields.
2. select the email field from the available bucket under the caller field and add it to the selected bucket (it adds caller.email field to the available bucket) and save it.
it automatically populates the caller's email ID after selecting the caller name
Please mark my answer correct & helpful, if it helps you
Thank you
Thank you
G Ramana Murthy
ServiceNow Developer