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

Thanks for help so far ..

I just blindly copied the script that you suggested and pasted it into my instance.

Im not sure where 'u_mhs_requested_for" is , it is not a variable that i have created.

 

I tried changing it to just 'current.requested_for.getDisplayValue()' incase that name was specific to the other persons instance - but that still came back as undefined.

then remove that line.

The script was just for your reference and not to be copied directly. you should enhance to suit your case

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

Regards
Ankur

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

@Andy Pickles 

Thank you for marking my response as helpful.

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

Regards
Ankur

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

Andy Pickles
Tera Contributor

Hi Ankur , yes we are using OOB email notification

then you need to include email script in that and show the variables

Solution link I already shared above.

Regards
Ankur

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