Integrations

Set Up an Email Integration via Inbound Actions

Email integrations let you create incidents, requests, and other records automatically when users send emails to a shared mailbox. This guide walks you through configuring the mailbox connection and inbound actions that parse emails into structured ServiceNow records.

Why email integrations replace manual data entry

Before email integrations, someone had to manually transcribe emails into ServiceNow records — users would email IT@company.com asking for help, and a technician would copy the request details into an incident record. This created delays, introduced transcription errors, and meant important details like original timestamps and sender information got lost. IT teams, HR departments, and facilities groups all dealt with this same problem: emails sitting in shared inboxes waiting for manual processing.

How inbound email processing works

ServiceNow polls a POP3 or IMAP mailbox at regular intervals and runs your inbound email actions against each new message. An inbound action is a condition (sender domain, subject keywords, etc.) paired with a script that creates or updates records. You start with a basic action that creates incidents from any email, then add conditions to route different email types to different record types. The email object in your script contains parsed headers, body content, and attachments. For replies and threading, ServiceNow embeds a watermark in outbound emails and looks for it in replies to link conversations.

Production improvements and advanced routing

Once basic email-to-record creation works, you'll want to add email parsing to extract caller information, automatic assignment based on sender or content, and attachment handling. Smart implementations use regex to parse structured data from email signatures or bodies, create child records for different request types mentioned in the same email, and integrate with external systems to validate senders. The difference between a basic integration and a production one is error handling — what happens when the sender isn't in ServiceNow, when the email format changes, or when the script fails partway through processing.

Before you start

  • admin role or inbound_email_action.admin
  • POP3 or IMAP mailbox credentials with polling access
  • Network connectivity from ServiceNow to your mail server
Sourdough
Chrome Extension

Sourdough: ServiceNow Monitoring and Analytics

A Chrome extension for ServiceNow Admins and Developers with essential tools, analytics, graphs and monitoring features.

Instance HealthGraphs & ChartsAPI HealthDeveloper ToolsQuick SearchInstance Switcher
Add to Chrome

Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.

Overview
Tasks
CMDB
API
Metrics
Monitor
Internals
Instance:sourdoughdev·Version:Yokohama
Instance StateONLINE
System StatusFully Operational
Session Timeout90 minutes
Logged-In Sessions2 (20 active)
Build Nameyokohama-12-18-2024_p1
IP Address10.159.128.43
Instance HealthHealth Score: 90%
🔥 5dSourdough (Chrome Plugin)Dark Mode

Step by step

1

Configure the inbound mailbox

Navigate to System Mailboxes > Inbound and click New. Enter your POP3 or IMAP server details in the Server field, set the correct Port (usually 995 for POP3-SSL, 993 for IMAP-SSL), and check SSL if your server requires it. Set User name and Password to your mailbox credentials. Leave Poll interval at 60 seconds for testing — you can increase it later.

TIP

Test the connection immediately with the Test button before configuring actions — authentication issues are easier to debug now than after you've written scripts.

2

Create your first inbound action

Go to System Mailboxes > Administration > Inbound Email Actions and click New. Set Name to something descriptive like 'Create incident from IT emails'. Leave Condition empty for now — this action will process all emails. In the Target table field, select 'Incident [incident]'. Check Active to enable the action.

3

Write the record creation script

In the Script field, add code to create your record. Start with: current.short_description = email.subject; current.description = email.body_text; current.caller_id = email.origemail; The email object contains all message data — email.subject, email.body_text, email.body, email.origemail (sender), and email.recipients. Set whatever fields make sense for your use case and click Submit.

4

Configure email threading conditions

If you want replies to update existing records instead of creating new ones, add a condition to check for ServiceNow watermarks. In the Condition field, enter: email.body.indexOf('[code:') > -1. This looks for the watermark ServiceNow embeds in outbound emails. Create a separate action for replies with script: var incident = getRelatedRecord(email); if (incident) { incident.comments = 'Email reply: ' + email.body_text; incident.update(); }

5

Set action order and conditions

Back in your action list, set Order to 100 for your reply-handling action and 200 for your create-new-record action. Actions run in order, so replies get processed first. Add specific conditions to target the right emails — use email.subject.indexOf('keyword') > -1 for subject filtering or email.origemail.indexOf('@yourcompany.com') > -1 for sender domain filtering.

6

Enable mailbox polling and test

Return to your inbound mailbox record and check Active, then set Poll interval to 30 seconds for testing. Send a test email to your configured address and watch the System Logs > Emails for processing results. Check both that records get created and that any error messages make sense. Once working, increase poll interval to 300 seconds or higher for production use.

Best practices

  • Always handle the case where email.origemail doesn't match a ServiceNow user — either create a default caller or use email address as caller ID to avoid null reference errors.

  • Don't use email.body for parsing — it contains HTML and is unreliable across email clients. Use email.body_text for consistent plain text content.

  • Set specific conditions on each inbound action rather than relying on script-level filtering — unconditioned actions process every email and slow down mail processing.

  • For email threading to work, recipients must keep the ServiceNow watermark [code:xxxxx] in their replies — document this requirement for users.

  • Create a catch-all inbound action with Order 999 that logs unprocessed emails to a staging table so you don't lose messages that don't match your conditions.

Test Your Knowledge

Quick 3-question quiz — see how your ServiceNow skills stack up.

Question 1 of 3Performance

A list view on a table with millions of records is slow. Best fix?

Select an answer to continue