Populating the "Company" field (of an "Affected user" on a Record Producer) on the Incident form

Marlowe Klingv4
Kilo Contributor

Hi

I'm totally new to this, so please bear with me. And, if you know of a particular place I could get further information, please let me know. Anyway, here's what I'm struggling with:

We have made a form for submitting an incident using the Record Producer. On this form, which is displayed on the Service Platform, we have a field that populates an "Affected user" field on the Incident form. What we would like to do is that we would like to populate the Company field on the Incident form with the name of the company that the "affected user" belongs to. We were told that this could be done from the Record Producer and that wouldn't have to use a script. However, I cannot find a way to do this. So, if anyone have a potential solution for this, I would be very grateful. If the solution requires scripting, I will do my best to apply that correctly as well.

Oh, we're on a Kinston Developer Instance.

Kind regards

/Marlowe

 

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

You can add script to the record producer What It will Contain->Script 

 

current.company = producer.affected_user.company;

 

please use the fields according to your Record Producer and Incident field.

 

 


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

4 REPLIES 4

SanjivMeher
Kilo Patron
Kilo Patron

You can add script to the record producer What It will Contain->Script 

 

current.company = producer.affected_user.company;

 

please use the fields according to your Record Producer and Incident field.

 

 


Please mark this response as correct or helpful if it assisted you with your question.

Dear Sanjiv and Pradeep

 

Thanks for you quick response. I tried and it worked great! Thanks a million! 🙂

 

/Marlowe

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

This could be done via Record producer script i.e

current.company = producer.PASS AFFECTED VARIABLE NAME HERE.company;

Screenshot for reference.

find_real_file.png

 

https://docs.servicenow.com/product/service_catalog_management/concept/c_PopulatingRecordData.html

 

-Pradeep Sharma

Marlowe Klingv4
Kilo Contributor

Dear Sanjiv and Pradeep

 

Thanks for you quick response. I tried and it worked great! Thanks a million! 🙂

 

/Marlowe