Need to display the variable value in additional comments

suuriyas
Tera Contributor

HI Community,

 

I have a scenario where in a record producer there is variable called "description" and then submitting the form the value entered in description field need to be displayed in the additional comment of that record.

 

How can we achieve this?

 

Thanks in advance

1 ACCEPTED SOLUTION

Shruti
Mega Sage
Mega Sage

Hi

Navigate to Service catalog -> Record producers -> Open the record producer

Add below line to the record producer script 

current.comments = producer.description;

View solution in original post

4 REPLIES 4

Shruti
Mega Sage
Mega Sage

Hi

Navigate to Service catalog -> Record producers -> Open the record producer

Add below line to the record producer script 

current.comments = producer.description;

Sujatha V M
Kilo Patron
Kilo Patron

@suuriyas  You try the below to get the value passed to additional comments, 

 

In the OOB, on the "Create Incident" record producer I have variable and the script as below which passes the value to "Description" field. 

 

SujathaVM_0-1739863974250.png

 

SujathaVM_1-1739864046862.png

 

For your scenario, I had commented the line no 34 and have passed it to "Additional Comments" as below

 

SujathaVM_2-1739864131942.png

 

By doing this, the value is passed to additional comments of the record from the variable. 

SujathaVM_4-1739864381338.png

 

Note: Make sure the variable database value is matching your syntax accordingly. 

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

Ankur Bawiskar
Tera Patron
Tera Patron

@suuriyas 

in the record producer script use this

current.comments = producer.description;

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

V V Satyanaraya
Tera Contributor

Hi @suuriyas ,

 

please us the below script in record producer

 

if (producer.description) {
current.work_notes = "User entered description: " + producer.description;
current.comments = producer.description; // For Additional Comments
}