Send email Activity - Process Automation Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 03:08 AM
Hi All,
We are expecting a custom activity to pre-populate the description + number of the Incident as a body and subject in the send email activity, later end user may edit the body and send the email from the playbook interface.
Can a custom email activity be created to achieve the above scenario?
Any response and feedback is highly appreciated
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 03:37 AM
Hi @Shantharao ,
I faced this, what i have done is Created new activity and associated with a new subflow.
The output of this activity is then used in the send email activity
Subflow -
inputs --> Case record
outputs--> Email body
Used action 'Get Catalog Variables' and prepared email body by assigning it to output variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 04:33 AM
Hi,
Thanks for the response could you please provide the step by step process with the script if possible, I am new to flow designer and process automation designer process space
Thanks in advance for your response, have a nice day
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 08:25 PM
Hi Sandeep,
I have the same requirement for this kind of scenario, can you share your approach and maybe some screenshots?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 03:59 AM
Yes, a custom email activity can be created to achieve the above scenario. Here are the steps to create a custom email activity:
1. Navigate to Flow Designer in ServiceNow.
2. Click on "New Action" to create a new custom activity.
3. Name the action and provide a description.
4. In the "Inputs" section, add the necessary inputs such as Incident Number and Description.
5. In the "Script" section, use the GlideRecord API to fetch the incident details based on the inputs.
6. Use the gs.email API to send an email. The subject and body of the email can be pre-populated with the incident number and description.
7. Save the action.
Here is a sample code:
javascript
(function execute(inputs, outputs) {
var gr = new GlideRecord('incident');
if (gr.get(inputs.incident_sys_id)) {
var emailSubject = 'Incident: ' + gr.number;
var emailBody = 'Description: ' + gr.description;
gs.email(inputs.email_address, emailSubject, emailBody);
}
})(inputs, outputs);
This script fetches the incident details based on the sys_id provided as input, and sends an email with the incident number as the subject and the description as the body.
Please note that the end user will not be able to edit the body and send the email from the playbook interface. The email is sent automatically by the script. If you want the end user to be able to edit the email, you may need to create a custom user interface for this purpose.
nowKB.com
For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/
For the ServiceNow Certified System Administrator exams try this :
https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER