Inbound Action in ServiceNow
TechSavvy
·
Jan 09, 2024
·
article
These are my notes from this great tutorial by Saaswithservicenow.
- Inbound actions process emails sent to the ServiceNow instance email address.
- Similar to business rules they also use conditions and scripts that take action on a target table.
- Process the emails to create the records in the system or update the records if a watermark is found or a condition is met.
When the system (SN) receives emails then the inbound action will get triggered and thus create records in the system or update the records if a watermark is found or a condition is met.
Note:
Every instance has its own email address that receives the emails.
The format of an email address of a SN instance is: @service-now.com
Whenever emails are received by SN then the system can take two actions:
- Record action: create/update fields of the target table
- Email reply: the system will respond back from the same source from where the email is received (i.e., auto-response)
Type Of Email Received
These are the categories of the emails that SN gets:
Foward
Should meet all conditions:
- The subject contains "Fw"
- The body contains a "From" string
SN treats any received email as Forward when the subject contains "Fw" and the body contains a "From" string.
Should meet one of the conditions:
- The subject or body contains a watermark
- No watermark and the Reply-To header contains a recognized message ID of an email with a target record
- No watermark and the subject line contains string RE: and a number of any record that existed in the instance
If any of these conditions are met, then the system will classify that as a Reply type of email.
Note:
By default, the system generates a watermark label which is embedded at the bottom of each notification email. The purpose of it is for the system to recognize an incoming email & match it with the existing record.
The system automatically creates a random number (alphanumeric) that is embedded at the bottom of each email notification. If someone responds to the same email notification, then the system will catch that notification and will treat it as the existing record.
No matches related to forward and reply.
So, if no matches are found for forward and reply types of email, then the incoming email is considered as a new email.
ServiceNow identifies which inbound action should run by assessing inbound email type and conditions as per incoming email messages.
- When incoming email matches the type of inbound action
- The watermark or record number is found in the target table
- When conditions mentioned in inbound actions become true
Inbound Action gets triggered when all these three conditions are met.
In this module, you can manage and create new inbound actions as per your requirements.
This is an example of an inbound action form.
Note:
Stop processing checkbox: to disable other inbound actions to run.
You can access the email content via field actions but also with the help of scripting. This way you can update the existing record with the matched email body content.
- email.to
- email.direct
- email.copied
- email.body_text
- email.body_html
- email.from
- email.from_sys_id
- email.origemail
- email.recipients
- email.recipients_array
- email.content_type
- email.headers
- email.importance
- email.subject
Email object vars are the different vars that store various types of content which you can use in the script to process emails and update the existing record.
In this module, you can track the email logs of inbound actions and email notifications.
This is an example of a processed email.
Note:
Because of some system issue, an email can sometimes not get processed correctly. The Reprocess Email action comes in handy to reprocess the incoming email in the system so that the inbound action gets triggered.
In the properties module, you can change the behavior of inbound emails by updating email properties. You can access the inbound email properties on the right side of the page.
Use case:
Reopen an incident when the user replies and the subject contains "please reopen"
When to run:
Actions:
This is another example of an inbound action I posted some time ago.
Reference:
Recap
Inbound Actions are very powerful. It allows the system to be very flexible and dynamic in creating tickets with prepopulated data from incoming or received emails.
That's a wrap!
Happy learning!
https://www.dancovic.com/2024/01/inbound-action-in-servicenow.html