---
sourceDocument: Australia Platform security
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/platform-security

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia Platform security

ft:clusterId :

    - psec

bundleId :

    - psec

workflow :

    - Platform


---

# Domain-separate a custom table

# Domain-separate a custom table {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 Minuten Lesedauer

You may need to create custom tables in separate domains. This topic covers both the
procedure and the concept behind domain-separating a custom table.

## 1. Create a sys_domain field {#bp-ds-custom-table__section_gtv_t2t_rhb}

Hinweis:  
If a system table or a table has not been domain-separated by the Domain Separation plugin, it's best not to domain-separate it. Use these points as a guideline to create a sys_domain field.  
* Create a new field as a domain_id type.
  * Column Name: sys_domain
  * Other attributes: Defined automatically
  {#bp-ds-custom-table__ul_mhy_ght_rhb}
* The Sys_domain_path is created automatically.
{#bp-ds-custom-table__ul_h3c_cht_rhb}

The column name sys_domain is reserved in the ServiceNow AI Platform,
which means that the system recognizes it and automatically applies the appropriate field type
and attributes for you. This automatic configuration also creates a corresponding
sys_domain_path field.  
* Set the column name to `sys_domain` rather than using the label.
* Domain separation is not appropriate for every table. In general, if a table is part of the base instance and that table does not have a sys_domain field, you should leave it that way.
{#bp-ds-custom-table__ul_g2y_vht_rhb}

A sys_domain field is created automatically when you create a domain_id
type field with the name "sys_domain."

## 2. Add a business rule to set the domain {#bp-ds-custom-table__section_npz_m3t_rhb}

Without business rules
:   The domain is set to the current domain of the user who creates the record.

With business rules
:   The domain is assigned using scripted logic, typically based on the Company field.

In addition to a `sys_domain field`, custom tables need a business rule similar
to Domain - Set Domain -- Taskto set the value of the domain field. In
addition, you will need Domain -- Default -- Task, which moves records
without a domain to the default domain if the first rule fails to assign a domain.

On the task table, review the business rules for Domain. Pay particular attention to the Order field. The priority of execution is given by the Order field from low to high.

The first rule that runs, Domain -- Set Domain -- Task, attempts to set
the domain of the record based on the record's Company's Domain.

If the first rule fails to find an appropriate domain, the second rule, Domain -- Default -- Task, executes. This rule sets the domain of the record to the default
domain.

Finally, if the domain of a task record changes, the Domain -- Cascade Domain -- Task business rule changes the domain on all records related to the task, such as
workflows, metrics, SLAs, and attachments.

## 3. Add a business rule if Step 2 failed {#bp-ds-custom-table__section_omc_1lt_rhb}

If the initial business rule fails to set a domain and the domain is still empty or global, a
second business rule runs. This rule examines the `task_for` field that is based
on the caller or `requested_for` field. This rule is checking to see if you can
set the domain of the record based on the user's domain. If not, the business rule sets the
domain to the default domain.

Following is a sample script for the business rule:  

    /* essentially
    If (task_for is set)
      set the domain to the user's domain
    ELSE
      set the domain to the default domain
    */

## 4. Domain -- cascade domain -- task {#bp-ds-custom-table__section_gl5_vlt_rhb}

Tasks can have many related tables that work together for business objectives. These related
records include workflow, SLA, approvals, attachments, and email. If the domain of a task
changes, the related records domain must change, too, so they remain visible to users in the new
domain.

This Cascade rule is commonly triggered when you clear records out of the default domain.

The related records for a Cascade domain contained in the Script are shown similar to the
example:  

    /*
    * Keep domains in sync w/related records for:
    * workflow context
    * workflow history
    * approver tables and related workflows
    * attachments
    * emails
    */

**Zugehörige Konzepte**   

* [Domain separation explained](https://servicenow-prod.fluidtopics.net/x9xyVWl9u0yhkSMd6PgbBw "With domain separation, you can segregate application data, UI, and business logic, such as rules or workflows, in a single customer instance. Separating these elements into logically defined domains supports specific hierarchies for all customers using your applications.")
* [Context and domain separation](https://servicenow-prod.fluidtopics.net/hSeeFgDzm2U__u_XsOCBsg "The context of a user's session determines the processes, data, and user interface (UI) as the user browses through list views, home pages, reports, and knowledge articles. The context is determined by the processes that you create, the business rules that you set, your workflows, and other factors.")
* [How a database query works with domain separation](https://servicenow-prod.fluidtopics.net/yQ9RQVyEkZdMQEmVYhCGCw "Using database queries with domain separation in your customers' applications help them protect their data. These queries then speed up the configuration and build processes.")
* [Customizing domain properties and themes](https://servicenow-prod.fluidtopics.net/o~73HsH~C~Y8lCJBbqNjKA "You can customize your customers' company properties and themes within the domains that you have configured. Customization makes their instances fit in with their companies' overall look and feel.")
* [Managing domain separation for specific uses](https://servicenow-prod.fluidtopics.net/~rh2XIdcd8JY~l2bgFgr~Q "You can set up separate domains for email notifications and customize the properties of catalog, tables, users, groups, and views. This enables you to provide more specific behavior in each domain, giving your customers more flexibility.")
* [Configuring domain separation with the domain picker](https://servicenow-prod.fluidtopics.net/dB~D65eJSYPmKEJYOgd2RQ "Use the domain picker wisely, and remember the 80/15/5 approach so that you do not customize too much and impact the performance of your instance.")
* [Domain separation performance considerations](https://servicenow-prod.fluidtopics.net/P8ZuAavQomgk_~ZYZYkfyw "As you configure domain separation in your application and services, make sure that you consider the number and properties of domains you create. Too many property-heavy domains can impact the performance of your instance.")
* [Setting up domain hierarchies](https://servicenow-prod.fluidtopics.net/~BeGlrS5mkBAZC8MgNeHNw "You can avoid slowdowns and performance impacts in your instance by knowing how domain hierarchies work and by setting them up properly.")
* [Checking domain logs for errors and warnings](https://servicenow-prod.fluidtopics.net/hTDpifH47t2Gr1s9ep3duA "Check the domain logs to find errors or warnings in your domain path processes and hierarchy configurations.")
* [Importance of the Default domain](https://servicenow-prod.fluidtopics.net/s60j9ApH7YvVauD3Os2I4w "Organizing your domains is a crucial part of the domain separation process. If you don't set a default domain, new tasks and user records go to the global domain. Anyone can see the records in the global domain, which means that data can be seen when it is not supposed to.")
* [Contains queries and domain access](https://servicenow-prod.fluidtopics.net/z9rKyulEpro~zy87l2cNMg "Use a \"contains\" query only in special cases, such as when users or groups need to see data from a domain that they don't have access to, but you don't want to move those users to a domain. Creating domain \"contains\" and user or group access for a domain should be an exception, only when absolutely needed.")
* [Domain paths query method](https://servicenow-prod.fluidtopics.net/yWArrf6dWdJiSqzk7MV0rg "You can create effective queries with domain paths.")
* [Slow queries and SQL debugging](https://servicenow-prod.fluidtopics.net/MDCvsO1Iv3cuVtEHAH_bfg "Debugging SQL and slow queries can help you resolve slowness issues in an instance.")
* [Before Query business rules](https://servicenow-prod.fluidtopics.net/dYg_2l53Fdrn0m68dyF7wQ "You can use a Before Query business rule to help support data segregation on an instance. ServiceNow applications that support domain separation may support the separation of data and data routing only, have advanced business logic separation, or support tenant (customer) level administration of the application.")
* [Avoiding domain path in scripts](https://servicenow-prod.fluidtopics.net/bv~55hFZ7r56GVb0sh0iDg "Domain paths can cause the values of your script to change or even break, so don't use them in scripts.")
* [Domain separation and the Customer Service Management (CSM) plugin](https://servicenow-prod.fluidtopics.net/Vo~HSBl~YXh~9ao1ckJZHw "For the best outcome, be aware of how the properties in the CSM plugin work. When the plugin is enabled, you can see the status of your records in your domains.")  
**Zugehörige Verweise**   

* [Domain separation hierarchies](https://servicenow-prod.fluidtopics.net/SCHXcKE3qVwuIT~t3G1Hsg "Create a hierarchy when defining a domain architecture to track your processes and workflows.")
* [Segregating and securing data with domain separation](https://servicenow-prod.fluidtopics.net/XOxpsOY5MXa0uH9QRefifQ "You can segregate and secure data on the ServiceNow platform in multiple ways, depending on your customer's needs. ")
* [Alternatives to domain separation](https://servicenow-prod.fluidtopics.net/p_6ioFlafs3xFn~zvUKCyg "You can use a separate instance as an alternative to domain separation for your customers. A separate instance allows you the flexibility to meet the requirements for data separation within the groups and departments in an organization with little to no impact on others.")
* [Evaluating the need for domain separation](https://servicenow-prod.fluidtopics.net/4r7B5rm_p0mj2kqvK6uXug "You may find that domain separation doesn't always work for your customers' organizations. It's best that you base your decision to go with domain separation by looking at your customers' needs.")
* [Benefits of domain separation](https://servicenow-prod.fluidtopics.net/ILX1hP1qttb97unHeBSDJA "Domain separation may work better for your customers' organizations than any other method for separating the data between groups and departments.")
* [Domain separation levels of support](https://servicenow-prod.fluidtopics.net/UGOnrC3b1gBgenLDX_TxRQ "Choose from three categories for domain separation of an application for your customers' organizations.")
* [Service provider reference architecture](https://servicenow-prod.fluidtopics.net/I7hvZlnhK2CMWNxs17Ur2w "Your customers can access service provider (SP) services by using a portal that is designed for them to reach their domain-separated instance.")
* [Domain separation terms](https://servicenow-prod.fluidtopics.net/H1gx~UAruHKGV3488YLtEg "With a ServiceNow instance, you can improve efficiency, add greater security, and increase performance for your customer organizations. It's helpful to understand some of the most common terms as you create your configurations.")
* [Domain assignments](https://servicenow-prod.fluidtopics.net/mcw9B6D7asbF5cb6Qw3jhg "How you assign a domain impacts the value of the sys_domain field. The assignments contain designs and business properties that affect how the application functions in each domain.")

