How to map a field from a record producer using scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 03:58 AM
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.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 05:10 AM
okay, thanks Mark.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 05:16 AM
hi i'm using it on onSubmit.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 04:03 AM
Hi there,
What is the reason for choosing Catalog Client Script? You could use the Record Producer script field for this. Or is for example the assignment_group field also a variable on your Record Producer?
If going for Record Producer script, it could be as easy as:
if(producer.team == 'MAC') {
current.assignment_group = "some_sys_id";
}
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 05:15 AM
yes the field is there in the record producer but only a few of the list will be use so i gave that list in layman terms. Hence i need to map this through script.
if(producer.team == 'MAC') {
current.assignment_group = "some_sys_id";
}
as to the above - the if condition doesnt seem to be working in the record producer script section.
i have used the sript section to pass a couple of variable values to a multi-line text.let me try it there again.
thanks
Dhanya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 05:24 AM
Strange that the if condition doesn't work. So the variable you are after is "team" correct, and "team" is the actual value of this variable? Is the value also exactly "MAC"? Or is that the label, or a part of it?
Can you debug this?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field