pass variables to approval email

Andy Pickles
Tera Contributor

Hi All,

I have a workflow attached to a catalog item.

This item is just a request for a specific service, with variables containing text that describes what the user wants.

My first 'wiget' in the workflow is for approval.

When the approver gets the email, it doesnt describe what the request is for. I need some way to pass one of the variables to the email so the approver can read what it says.

I looked in the email template and it contains the line :-

Comments:
${sysapproval.description}

Which just produces a blank line in the email as that field is empty.

Please, how can i either populate the sysapproval.description field from within the workflow,

or somehow pass one of my other variables to the email so that i can let the approver see some details from the request

 

Many thanks

Andy

 

below is a picture of how the email currently arrives - for clarity (The short description just contains the name of the requested item) . I want to include some text from one of my variables into this email

find_real_file.png

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you cannot do this directly via dot walking

you would require email script for this

check this link for solution

Display the Requested item variables in approval notification

regards
Ankur

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

View solution in original post

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

are you using OOB email notification on approval table?

Regards
Ankur

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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you cannot do this directly via dot walking

you would require email script for this

check this link for solution

Display the Requested item variables in approval notification

regards
Ankur

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

Hi Ankur,

Thank you, I tried the script and it all works great, apart from 1 line  .. The line

template.print('Requested For: '+current.u_mhs_requested_for.getDisplayValue());

 

Just produces "Requested For : undefined"

 

Could you please help me fix that ?

Many thanks

Andy

Sure

Field "u_mhs_requested_for" is on RITM?

if yes then you must be already querying sc_req_item in email script

just use that GlideRecord object instead of current

obj.u_mhs_requested_for.getDisplayValue()

Regards
Ankur

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