How can I pass a catalog item variable to a mail script?

Anthony Dyer
Tera Contributor

I have created an Action in Flow designer to trigger an event which will send out a notification.  With in that notification I need to pass the date variable that the user inputs.  I have created a template and use the mail script to print this value, but it is coming back as undefined.  Here are screen shots of the Action and mail script.  Not sure what I am doing wrong and any assistance would be helpful.

 

Action:

find_real_file.png

Flow:

find_real_file.png

Mail Script:

find_real_file.png

1 ACCEPTED SOLUTION

Hi,

your event is on sc_req_item table

but in the event log the table is different

Unless the event triggers on the sc_req_item table it won't work

Can you check the inputs.template object belongs to which table

try adding this log

gs.info(inputs.template.sys_class_name); // check the table name

Regards
Ankur

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

View solution in original post

23 REPLIES 23

I had to change the mail script to pull the answers from the event queue.  Once I used the following code it functioned correctly.

 

var date = event.parm1;

template.print(date.bold());

Can you share the updated script with screenshots

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

Here is a screenshot of the final script.

 

find_real_file.png

Hi,

can you explain what is bold()

Regards
Ankur

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

I used the .bold() to make  the "date" bold in the email that is sent out.