Inbound Action in ServiceNow

Inbound Action in ServiceNow

These are my notes from this great tutorial by Saaswithservicenow.

Definition

  • 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.

Flow



Note:

Every instance has its own email address that receives the emails. 
The format of an email address of a SN instance is: <instance name>@service-now.com

Action Taken By System

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:
  • Forward
  • Reply
  • New

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.

Reply

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.

New

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.

PROCESS OF CLASSIFICATION OF INCOMING EMAIL

Email Processing

ServiceNow identifies which inbound action should run by assessing inbound email type and conditions as per incoming email messages.

FLOW OF INBOUND ACTION PROCESSING


When Inbound Action gets triggered

  • 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.

INBOUND ACTION MODULE


In this module, you can manage and create new inbound actions as per your requirements.

INBOUND ACTION FORM


This is an example of an inbound action form.

Note:

Stop processing checkbox: to disable other inbound actions to run.

SCRIPTING IN INBOUND ACTION


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 OBJECT VARIABLES

  • 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.

INBOUND EMAIL LOGS


In this module, you can track the email logs of inbound actions and email notifications.

Processed email


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.


INBOUND EMAIL PROPERTIES


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.

Create an Inbound Action

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.

Testing Inbound Action

Reference:

https://www.reddit.com/r/servicenow/comments/14xsxdi/is_there_a_way_of_testing_inbound_email_actions/

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!

Comments

Popular Posts