Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
How to make domain-specific inbound email actions - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • How to make domain-specific inbound email actions
KB0659203

How to make domain-specific inbound email actions


5053 Views Last updated : Jul 24, 2025 public Copy Permalink
KB Summary by Now Assist

Issue

By default, the system ignores the domain that the inbound email action record is in when it creates a record based on the inbound email action. Generally, you should create your inbound email actions in a global domain. However, if you have one or more domain-separate instances, you might need to create an Inbound action that is applicable only for a particular domain.

Guidelines

  • Make sure that the Overrides field of each inbound email action is empty.
  • For one particular table, make sure the order of each inbound action is unique.
  • For more details about how to create Inbound Actions, see the documentation topic Creating an Inbound email action.html

In the action tab of the inbound email action, make sure to add conditions to make the inbound email action domain-specific.

For example:

if(gs.getUser().getDomainID() != <sys_id_of_the_domain>

 These conditions ensure that the code enclosed within the condition will run ONLY IF the user who is sending the email is from the specified domain.

Having else if blocks also enable you to add multiple checks for multiple domains.

Example

This section provides a very simple example of how to create a domain-specific inbound email action.

  1. Make sure Domain Separation is active in your instance and the global domain is selected on the domain picker.

  2. Navigate to System Policy > Email > Inbound Actions and click New.

  3. Provide the following values:

    • Name: Create Incident – Oceanic
    • Target Table: Incident [incident]
    • Active: Check
    • Script:
    (function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
       if(gs.getUser().getDomainID() != 'c9434fce4a3623120181f955f4a3d6e9'){
          current.caller_id = gs.getUserID();
          current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
          current.short_description = "For Oceanic Domain : " + email.subject;
          current.category = "inquiry";
          current.incident_state = IncidentState.NEW;
          current.notify = 2;
          current.contact_type = "email";
          if (email.body.assign != undefined)
             current.assigned_to = email.body.assign;
          if (email.importance != undefined) {
             if (email.importance.toLowerCase() == "high")
                current.priority = 1;
          }
          if (email.body.priority != undefined)
             current.priority = email.body.priority;
             current.insert();
          }
       })(current, event, email, logger, classifier);
  4. Deactivate the Create Incident Inbound Action.

    1. Go to https://<instance>.service-now.com/nav_to.do?uri=sysevent_in_email_action.do?sys_id=3ccfeff5c611227a0180144333c87af9.

    2. Uncheck Active.

    3. Save the record.

  5. Navigate to User Administration > Users, then select the demo user Abel Tuter.

  6. Change Email to an email ID that you can also use, and change its domain to Oceanic Airlines.

  7. Send an email message to your ServiceNow instance's email ID from the email ID value you set.

    These steps create an Incident on the Oceanic Airlines domain. To check whether this inbound action works only on the Oceanic Airlines domain, send an email message from any other email ID that is associated with a user who does not belong to the Oceanic Airlines domain.

Current Limitations

  • The Domain and Overrides fields do not work in the Inbound Actions table.
  • Once an inbound section is created in the global domain, administrators from all domains can access and change it.

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.