How to Show catalog item variables on email notifications

Chaitanya Redd1
Tera Guru

Hello Team,

I need help how to show variables which added on catalog form through email notification. As shown below all that variables has to show on email notification. I have tried by creating Script Include.

find_real_file.png

Thanks,

JRY

1 ACCEPTED SOLUTION

Hi,

I have updated code as below and it worked for me

can you update these 2 lines

var value = current.variables.software_selection.toString(); // give proper variable name here

var parser = JSON.parse(value);

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

Regards
Ankur

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

View solution in original post

19 REPLIES 19

Hi,

can you share the RITM screenshot?

Does that RITM have info in that variable set?

Regards
Ankur

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

Hi Ankur,

Thanks for help, now I can see values on the  notification can we give space for each line and you can see for each software name Add/remove is coming with other value.

find_real_file.png

Thanks,

JRY

Hi,

for adding new line use this

(function runMailScript(current, template, email, email_action, event) {

          // Add your code here

var value = current.variables.software_selection.toString(); // give proper variable name here

var parser = JSON.parse(value);

for(var i=0;i<parser.length;i++){

template.print('Software name is: ' + parser[i].software + ' Option is: ' + parser[i].add_remove); // give proper variable name here

template.print('<br/>')

}

})(current, template, email, email_action, event);

Regards
Ankur

 

 

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

Thanks Ankur, it worked.

 

Thanks,

JRY

You are welcome

Regards
Ankur

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