how to auto set resolution notes field with particular catalog item variable.

keval3
Tera Contributor

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  

4 REPLIES 4

Juhi Poddar
Kilo Patron

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

 

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 

Ankur Bawiskar
Tera Patron
Tera Patron

@keval3 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@keval3 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader