how to auto set resolution notes field with particular catalog item variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2024 07:33 AM
Hi All,
I have below requirement
I have 1 catalog item called ASK me, in witch there are one variable called HR category with select box type, base on that variable choice resolution notes should be auto populated. kindly let me know how to do that.
Thanks & Regards
KP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2024 08:24 AM
Hello @keval3
Both HR Category and resolution notes are fields present on Catalog item?
If so then write an onChange Catalog Client Script on HR Category variable.
onChange Catalog Client Script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
// Mapping HR Category choices to Resolution Notes
var resolutionMap = {
'Payroll Issue': 'Please refer to the payroll guidelines.',
'Benefits Inquiry': 'Contact the Benefits team for details.',
'Leave Request': 'Ensure all approvals are documented.',
};
// Get the appropriate resolution note
var resolutionNotes = resolutionMap[newValue] || 'No specific resolution available.';
// Set the Resolution Notes field
g_form.setValue('resolution_notes', resolutionNotes);
}
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps others find the solution more easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2024 09:02 AM
Hi Juhi,
HR Category is the name of variable and witch is in the catalog item and resolution notes is the field name witch is in the sc_task.
Thanks & Regards
KP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2025 06:15 AM
did you try onChange catalog client script on HR category variable and set the field using
g_form.setValue('resolution_notes', 'Your Value');
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 09:07 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader