- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2018 12:23 PM
Hi,
I am hoping someone can assist me. I am having a problem with the Advanced Script in the Workflow Notification. I have to send a notification also to the user on the catalog form variable field. The user is in a reference field, I have tried several things, but it seems to only send an email to the 2nd email after the comma (acessrites@test.com).
I have tried different approaches, but to no avail.
answer = (current.variable_pool.st_employeename.email);
Am I missing something?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2018 12:46 PM
To understand why its not working, you need to know how recipients list works for the emails in ServiceNow. A recipient list will be filtered for valid email addresses before sending an email.
So your recipient list according to your code is
So your code should be something like this below
answer= current.variables.st_employeeemail.email+",acessrites@test.com";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2018 12:30 PM
try removing quotes, just use current.variables.st_employeeemail (guessing this would be an email?)
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2018 12:46 PM
To understand why its not working, you need to know how recipients list works for the emails in ServiceNow. A recipient list will be filtered for valid email addresses before sending an email.
So your recipient list according to your code is
So your code should be something like this below
answer= current.variables.st_employeeemail.email+",acessrites@test.com";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2018 01:34 PM
Thank you! That worked!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2018 12:46 PM
This should do it:
answer = current.variables.st_employeename.email + ",acessrites@test.com";
However, I would suggest that you NOT include the notification directly in the Workflow. It would be better to raise the event instead and have a Notification respond to that event instead. This way is easier because any updates to the Notification can happen outside of the Workflow. If within the the Workflow, you would need to publish a new version of it and any currently running workflows would not get the updates.