How to auto populate a record producer field based on reference field selection.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â07-20-2021 04:27 AM
Hi,
I want to auto populate the field DESC with the description of the incident selected in field INC.
Once the incident has been selected, the description of the incident should auto fill.
How can this be achieved with a catalog client script to do a glide ajax to a script include?
All help is appreciated, thanks in advance!
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â08-18-2021 07:55 AM
Hi
If I helped you to resolve your query with my answer. Then I would really appreciate if you can mark my answer correct and helpful. So that it can be moved to answered list and helpful for future readers.
Regards,
Ujjawal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â07-20-2021 04:38 AM
Hi
This can be done using onchange client script. Please make sure you run script on change of incident field and update variable names correctly below.
Try below code
var selected_value = g_form.getReference('incident', myCallBack);
function myCallBack(selected_value) {
g_form.setValue('description',selected_value.description);
}
Thank you
Prasad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â07-20-2021 04:51 AM
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â07-20-2021 08:19 PM
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â07-27-2021 03:45 AM
Please mark my response correct and helpful. If I am able to help you with your query and it can be moved to answered list and helpful for future readers.