How to add "Requested for" in cc in "Notification" activity of workflow

sameekshasa
Tera Contributor

Hi @Ankur Bawiskar ,

I want to send a notification using a workflow. In the "To" field, I have added a distribution list (DL). In the "CC" field, I need to include the "Requested For" user, which will be selected by the user when submitting the form. Could you please suggest how this can be achieved? Do I need to write an email script and reference it in the "To" field as well?

Thanks in advance!

1 ACCEPTED SOLUTION

@sameekshasa 

you need to use <mail_script> within that notification activity message

AnkurBawiskar_0-1770181731343.png

Give correct variable name

<mail_script>
	email.addAddress('cc',current.variables.requestedFor.email.toString(),current.variables.requestedFor.name.toString());

</mail_script>

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

View solution in original post

5 REPLIES 5

yashkamde
Kilo Sage

Hello @sameekshasa ,

 

use -> email.addAddress("cc", "requested_for","ABC");

In Email Script 

and call ${mail_script:email_script} -> in Notification

If my response helped mark as helpful and accept the solution.