How to Map a Variable from Record Producer to a field on Incident form?

User177031
Kilo Guru

HI All,

I am having a variable as 'Users Affected' (Values - Widespread, Large, Limited, Localized) on Record Producer and I want to map this to 'Impact' field on Incident form.

Widespread - Critical

Large - High

Limited - Medium

Localized - Low

Example - When User submit an Incident through record producer with Users Affected as 'Large', it should show as 'High' Impact on the Incident form.

Please help me to achieve this requirement.

- Thank you.

 

1 ACCEPTED SOLUTION

senthilvaithees
Tera Guru
Write a script like this if(producer.user_affected=='large') current.impact ='high';

View solution in original post

7 REPLIES 7

The SN Nerd
Giga Sage
Giga Sage


If you click 'Map to field' on your Variable and ensure the Value for each Catalog Variable choice value maps to the Incident choice value, you should be golden.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hi Paul,

This variable is on the Variable set. I don't think we have 'Map to field'.

- Thank you. 

Yeah, you'll need to write some code in the Record Producer Script as below.

I would suggest still using the same choice values (as the number value of impact you want to map to) so you can do it in one line of code in your Record Producer (What it will contain tab, script field). The script is server side.

current.impact = producer.user_affected;

 


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

senthilvaithees
Tera Guru
Write a script like this if(producer.user_affected=='large') current.impact ='high';