Workflow - send notification to an email address in a variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 06:11 AM
Hi,
I have a record producer (which triggers my workflow) with a "single line text-variable" called emailaddress.
In my workflow, I want to send a notification to the value entered in the emailaddress-variable.
Is this possible through the Notification-action in my workflow or do I have to create an event which triggers an email notification? If I need to trigger an email notification in the sysevent_email_action table - do I have to use an email script which fetches my variable-value?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 06:21 AM
Hi, Yes you can do this through the notification activity in a workflow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 06:24 AM
Hello,
Looks like you can add directly in Advance section of Notification activity with simple code like below. try once.
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 06:26 AM
You can also do this by using notification activity in your workflow.
In your notification activity, just check the Advanced checkbox and then write this script in it.
var emailID=current.variables.emailaddress ;
answer = [emailID];
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 06:35 AM
Hello @Christoffer Lin ,
Yes you can do it in workflow activity.But you might have to write some script to push the notification like below in the advanced section
var gr = new GlideRecord('sys_user');
gr.addQuery('email',current.variables.your_variable_backend_name);
gr.query();
if(gr.next())
{
answer = gr.sys_id.toString();
}
Hope this helps
If this helped you mark my answer correct
Thanks