How to map a field from a record producer using scripts

Dhanya
Kilo Contributor

Hi i need help with a catalog client script. i'm trying to pass a value from the record producer to the incident based on value selected by the user. I understand we cannot use current to refer to the incident form,

if ((producer.team)== 'MAC'){
g_form.setValue('assignment_group','MAC-Support');}

i need this value to be mapped to the field in incident. But this is not working.

15 REPLIES 15

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use this in producer script

if(producer.team == 'MAC'){
current.setDisplayValue('assignment_group','MAC-Support');
}

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Thanks Ankur, let me try this.

when i use current in a client script, it throws an error.

Dhanya
Kilo Contributor

this didnt work.