How do I map Record Producer Variables with HR case form fields?

Tapish Sharma
Tera Contributor

I want to Map Record Producer variables with the HR case form fields for a particular HR service.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Tapish,

There are multiple ways to map that

1) Using the Map to Field on Variable

  • When you will make a variable in record producer(no tin a variable set),there you will see an Checkbox names "Map to field".
  • Tick this checkbox and then you will get an "field" in this you can select field of target table to map record producer's variable to target table's field.

2) Using record producer script

Ex: current.field_name_of_target_table = producer.variable_name;

Regards
Ankur

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

View solution in original post

12 REPLIES 12

There are OOB scripts updating the State on HR Cases.  If you go to your created HR Case, when the record producer is submitted, look at the History to see if the State is ever getting updated with your mapped value.  The State could be getting overridden by the Template or Script Include.

The Script Include being hr_ServicesUtil called from the Record Producer's Script.

new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);

so should i disable the OOB script?

Hi,

please comment that line from record producer script or remove it from that place

Regards
Ankur

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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Tapish,

There are multiple ways to map that

1) Using the Map to Field on Variable

  • When you will make a variable in record producer(no tin a variable set),there you will see an Checkbox names "Map to field".
  • Tick this checkbox and then you will get an "field" in this you can select field of target table to map record producer's variable to target table's field.

2) Using record producer script

Ex: current.field_name_of_target_table = producer.variable_name;

Regards
Ankur

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