- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 10:42 AM
Team, I am attempting to send out a scheduled report from a specific user with the display name being "Change Advisory Board". I saw the below script in another thread, but it is 7 years old so I'm not sure how it holds up as I am new to Java Script.
I planned to add this to my scheduled report.
${mail_script:u_setFromScheduled}
Therefore I created this new notification email script u_setFromScheduled with 'Script'
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 10:49 AM - edited 04-08-2024 10:55 AM
Hi @tiguin2798 ,
Here's the breakdown of the issue:
- Incorrect character: There's a non-breaking space character ( ) before Travis Leach. This character might not be interpreted correctly by ServiceNow.
- Missing closing parenthesis: The closing parenthesis after the email address is missing.
Explanation:
- The email.setFrom method takes a single string argument that specifies the sender's name and email address in the format "Name <email@address.com>".
Corrected Script -
(function runMailScript(event) {
email.setFrom("Travis Leach<abc@abc.com>");
})(current, template, email, email_action, event)
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 10:49 AM - edited 04-08-2024 10:55 AM
Hi @tiguin2798 ,
Here's the breakdown of the issue:
- Incorrect character: There's a non-breaking space character ( ) before Travis Leach. This character might not be interpreted correctly by ServiceNow.
- Missing closing parenthesis: The closing parenthesis after the email address is missing.
Explanation:
- The email.setFrom method takes a single string argument that specifies the sender's name and email address in the format "Name <email@address.com>".
Corrected Script -
(function runMailScript(event) {
email.setFrom("Travis Leach<abc@abc.com>");
})(current, template, email, email_action, event)
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 12:16 PM
@Astik Thombare Thank you so much!! I tested this and it worked perfectly. Thank you for the timely assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 07:57 AM
Can I ask where you added "${mail_script:u_setFromScheduled}" into your scheduled report?
I seek the same results, but am at a loss as to where this would be placed.
Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2024 08:10 AM