onchange client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2024 06:16 AM
how to populate the caller manager details in to the short description field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2024 09:15 AM
Hi,
This can be achieved by creating an OnChange Client Script on the Caller Manager field and then use the below code in your script to set the value:
function onChange(control, oldValue, newValue, isLoading) {
g_form.setValue('short_description', newValue);
}
If you find this helpful, please mark this reply as the solution. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2024 10:44 AM
Use GlideAjax in the onChange Client Script to call a Script Include, passing in the caller (sys_id). The SI will query the user table to get the manager record, then you can build an object of the fields from the manager record that you want to return to the client to populate in the text field. Here's an excellent guide
Give the scripts a shot and post them if you get stuck.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2024 10:46 AM - edited ‎01-29-2024 10:46 AM
Hi there,
Is this in platform ui? Or perhaps portal? Or somewhere else (since you are posting this under Virtual Agent).
If this is for example portal, there might be other (no code) options than for coded platform UI options. So please be more specific so we can help you correctly.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field