Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Pull reference variable value into email notification

nicolemccray
Tera Expert

I'm trying to pull in the display value of my reference variable 'vend_name', but will not work.   The 'Requested For First Name' is pulling in as expected:

Hello ${request.requested_for.first_name},

Your request for a New Mexico Non-Taxable Transaction Certificate (NTTC) for ${current.variables.vend_name.getDisplayValue()} has been completed. Please find attached the certificate for your use.

1 ACCEPTED SOLUTION

Nicole, you don't need to use a mail script and that is causing the extra line.   Use the following instead:


Hello ${request.requested_for.first_name},


Your request for a New Mexico Non-Taxable Transaction Certificate (NTTC) for ${request_item.variables.vend_name} has been completed. Please find attached the certificate for your use.


Thank you,


View solution in original post

22 REPLIES 22

This is what I had initially before I added 'getDisplayValue', and was not working.


Hi Nicole,



are these variables on a request Item? If so you will need to write a mail script in order to pull them in


I tried the following script:



find_real_file.png




And this in my notification:



Hello ${request.requested_for.first_name},


Your request for a New Mexico Non-Taxable Transaction Certificate (NTTC) for ${mail_script:nmnttc.vend_name} has been completed. Please find attached the certificate for your use.


</mail_script>




Still no go


Hi Nicole,



attached is the mail script we use to pull in a variable to a notification. Hope this helps



Variable mail script.png


Nicole, you really don't need a mail script to accomplish this.   Can you please:


  • Provide table name that your notification is using
  • Post a screen capture of your variable?   I need to see the name of the variable.
  • Confirm you can see this variable in the variable editor on the task


Thanks