---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# PADomainUtils - Global

# PADomainUtils - Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read

The PADomainUtils API enables you to copy Performance Analytics records
between different domains on the same instance.

Use this API in server scripts to copy Performance Analytics records such as indicators,
breakdowns, and dashboards, to different domains. This API enables you to create a Performance Analytics record in one domain and copy that record to any number of additional
domains.  
Note:  
This API cannot copy records into the Global domain.  
Warning:  
When configuration records are moved to another domain, scores will not be accessible.  
To use PADomainUtils, you must satisfy these requirements:

* Performance Analytics must be enabled.
* The user running the script must have the admin role.
* The instance must use domain separation.
* The script must be run from the global domain.
* When moving or copying records, the source and target domains must be different.
{#c_PADomainUtils__ul_fyh_sjs_ht}

## PADomainUtils - PADomainUtils() {#ariaid-title2}

Instantiates a new PADomainUtils object to move or copy Performance Analytics records from
the global domain.
Use the PADomainUtils(String domainFrom) constructor instead when moving
or copying records from a domain other than the global domain.
{#r_PADU-PADomainUtils__table_tm5_rmy_2t__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 1. Parameters]

{#r_PADU-PADomainUtils__table_tm5_rmy_2t}  

    // PADomainUtils initialized with the global domain
    var globalUtils = new SNC.PADomainUtils();

## PADomainUtils - PADomainUtils(String domainFrom) {#ariaid-title3}

Instantiates a new PADomainUtils object to move or copy Performance Analytics records from
the specified domain.
Use the PADomainUtils() constructor instead when moving or copying from
the global domain.
{#r_PADU-PADomainUtils_String__table_ly4_5my_2t__entry__3}

| Name | Type | Description |
|-|-|-|
| domainFrom | String | The domain to copy records from. |
[Table 2. Parameters]

{#r_PADU-PADomainUtils_String__table_ly4_5my_2t}  

    // c90d4b084a362312013398f051272c0d is the sys id of the ACME domain
    var acmeUtils = new SNC.PADomainUtils('c90d4b084a362312013398f051272c0d');

## PADomainUtils - copy(String runAs) {#ariaid-title4}

Copies Performance Analytics records to a different domain.
To copy dashboards or scheduled jobs, see [copyDashboard](https://servicenow-prod.fluidtopics.net/a6yeeU7defp0wKfqbZqfDA#PADU-copyDashboard_S_S "Copy a dashboard to another domain.") and [copyJob](https://servicenow-prod.fluidtopics.net/a6yeeU7defp0wKfqbZqfDA#r_PADU-copyJob_String_String "Copies a Performance Analytics scheduled data collection job record to another domain.").
{#r_PADU-copy_String__table_n55_zky_2t__entry__3}

| Name | Type | Description |
|-|-|-|
| runAs | String | User whose domain you want to copy records to. |
[Table 3. Parameters]

{#r_PADU-copy_String__table_n55_zky_2t} {#r_PADU-copy_String__table_o55_zky_2t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 4. Returns]

{#r_PADU-copy_String__table_o55_zky_2t}  

    // copy all the Performance Analytics records from global to user's domain
    var pa = new SNC.PADomainUtils();
    pa.copy('09ff3d105f231000b12e3572f2b4775d');

## PADomainUtils - copyDashboard(String dashboardId, String runAs) {#ariaid-title5}

Copy a dashboard to another domain.
{#PADU-copyDashboard_S_S__table_yds_v55_yw__entry__3}

| Name | Type | Description |
|-|-|-|
| dashboardId | String | Sys_id of the dashboard to copy. |
| runAs | String | User whose domain you want to copy the dashboard to. |
[Table 5. Parameters]

{#PADU-copyDashboard_S_S__table_yds_v55_yw} {#PADU-copyDashboard_S_S__table_zds_v55_yw__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 6. Returns]

{#PADU-copyDashboard_S_S__table_zds_v55_yw}  

    //Copy Incident Management dashboard from global to user's domain
    var pa = new SNC.PADomainUtils();
    pa.copyDashboard('a64b7031d7201100b96d45a3ce610335','09ff3d105f231000b12e3572f2b4775d');

## PADomainUtils - copyJob(String paJob, String runAs) {#ariaid-title6}

Copies a Performance Analytics scheduled data collection job record to another domain.
{#r_PADU-copyJob_String_String__table_gvt_vky_2t__entry__3}

| Name | Type | Description |
|-|-|-|
| paJob | String | Sys_id of a Performance Analytics scheduled data collection job \[sysauto_pa\] record. |
| runAs | String | User whose domain you want to copy the job to. |
[Table 7. Parameters]

{#r_PADU-copyJob_String_String__table_gvt_vky_2t} {#r_PADU-copyJob_String_String__table_hvt_vky_2t__entry__2}

| Type | Description |
|-|-|
| String | Error message if an error occurs, or an empty string if there is no error. |
[Table 8. Returns]

{#r_PADU-copyJob_String_String__table_hvt_vky_2t}  

    // No source domain needs to be set
    var pa = new SNC.PADomainUtils();
    // copy the '[PA Incident] Daily Data Collection job'
    // set the 'run as' of the new record to be the 'acme.itil' user
    // first argument is the sys_id of the sysauto_pa record
    // the second is the sys_id of the acme.itil user record
    pa.copyJob('82ba2023d7101100b96d45a3ce6103cd','797d14341f1310005a3637b8ec8b7010');

## PADomainUtils - isWriteable(String table, String id) {#ariaid-title7}

Evaluate if you can write to a specific record identified by table and
sys_id.
{#r_PADU-isWriteable_String_String__table_vqc_gly_2t__entry__3}

| Name | Type | Description |
|-|-|-|
| table | String | The name of the table containing the record to query, such as pa_indicators. |
| id | String | The sys_id of the record to query. |
[Table 9. Parameters]

{#r_PADU-isWriteable_String_String__table_vqc_gly_2t} {#r_PADU-isWriteable_String_String__table_wqc_gly_2t__entry__2}

| Type | Description |
|-|-|
| Boolean | Indicates that you can write to the specified record. Returns true if the record exists within the domain of the current user. Returns false if the record does not exist, or is in a different domain. |
[Table 10. Returns]

{#r_PADU-isWriteable_String_String__table_wqc_gly_2t}  

    var pa = new SNC.PADomainUtils();
    pa.isWriteable('pa_incidents','cd8125b5140012007665a83e633b028d');

## PADomainUtils - move(String runAs) {#ariaid-title8}

Moves Performance Analytics records to a different domain.
{#r_PADU-move_String__table_plw_bly_2t__entry__3}

| Name | Type | Description |
|-|-|-|
| runAs | String | The user whose domain you want to copy records to. |
[Table 11. Parameters]

{#r_PADU-move_String__table_plw_bly_2t} {#r_PADU-move_String__table_qlw_bly_2t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 12. Returns]

{#r_PADU-move_String__table_qlw_bly_2t}  

    // move all the Performance Analytics records from the global to the customers domain
    var pa = new SNC.PADomainUtils();
    pa.move('774190f01f1310005a3637b8ec8b70ef')

## PADomainUtils - setFoundation(Boolean foundation) {#ariaid-title9}

Use this method to move or copy only foundational records in a hybrid domain
configuration.
You can implement a hybrid approach by maintaining some types of record in a parent domain and some types in child domains. Generally, the parent domain contains foundational records and the child domain contains higher-level records, such as widgets. The following types of record are considered foundational records.

* Bucket groups
* Buckets
* Scripts
* Breakdown sources
* Indicator sources
* Filters
* Breakdowns
* Managed sources
* Manual breakdowns
* Breakdown mappings
* Breakdown relations

{#r_PADU-setFoundation_boolean__ul_ygw_ycf_ht}Other Performance Analytics records such as widgets and indicators are not foundational records. Set this method to false to move or copy these additional records as well.
{#r_PADU-setFoundation_boolean__table_tzb_nky_2t__entry__3}

| Name | Type | Description |
|-|-|-|
| foundation | Boolean | Indicates if only foundational records should be copied or moved by this PADomainUtils object. |
[Table 13. Parameters]

{#r_PADU-setFoundation_boolean__table_tzb_nky_2t} {#r_PADU-setFoundation_boolean__table_uzb_nky_2t__entry__2}

| Type | Description |
|-|-|
| PADomainUtils | The object calling this function. |
[Table 14. Returns]

{#r_PADU-setFoundation_boolean__table_uzb_nky_2t}  

    var pa = new SNC.PADomainUtils().setFoundation(true);
    pa.copy('bb6b58b01f1310005a3637b8ec8b70dd');

## PADomainUtils - setOverrides(Boolean overrides) {#ariaid-title10}

Use this method before copying records to set the sys_override value of the new record
to the original parent record.
Using this method enables you to automatically override records in a parent domain. By
overriding the parent records, the parent records do not impact the child domain. If the
source domain is not the parent of the target domain when copying records, setting the
sys_override value will not have any impact on behavior. You can specify an override only
when copying records, not when moving records.
{#r_PADU-setOverrides_boolean__table_hsj_qky_2t__entry__3}

| Name | Type | Description |
|-|-|-|
| overrides | Boolean | Indicates that copied records in a child domain should override the source record in the parent domain. This value is true by default. |
[Table 15. Parameters]

{#r_PADU-setOverrides_boolean__table_hsj_qky_2t} {#r_PADU-setOverrides_boolean__table_isj_qky_2t__entry__2}

| Type | Description |
|-|-|
| PADomainUtils | The object calling this function. |
[Table 16. Returns]

{#r_PADU-setOverrides_boolean__table_isj_qky_2t}  

    var pa = new SNC.PADomainUtils('c90d4b084a362312013398f051272c0d');
    pa.setOverrides(false);
    pa.copy('bb6b58b01f1310005a3637b8ec8b70dd');


