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


---

# ConnectionInfoProvider - Scoped, Global

# ConnectionInfoProvider - Scoped, Global {#ariaid-title1}

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

The ConnectionInfoProvider API provides methods to select connection
information through the connection alias.

You can use this API in scoped applications or within the global scope. In scoped scripts, use the `sn_cc` namespace identifier.

This function retrieves connection information identified by the given connection alias.  

    var provider = new sn_cc.ConnectionInfoProvider();

    // get a jdbc connection in the current domain with the alias ID
    //     "6219afbf9f03320021dd7501942e70fc"
    var connectionInfo = provider.getConnectionInfo("6219afbf9f03320021dd7501942e70fc");
    if (connectionInfo != null) {
      // get data map
      var datamap = connectionInfo.getDataMap();
      gs.info(datamap["name"]);
      gs.info(datamap["connection_url"]);

      // get the same values using getAttribute
      gs.info(connectionInfo.getAttribute("name"));
      gs.info(connectionInfo.getAttribute("connection_url"));

      // get credential attributes
      gs.info(connectionInfo.getCredentialAttribute("user_name"));
      gs.info(connectionInfo.getCredentialAttribute("password")); 

      // get extended attributes
      var extendedAttributes = connectionInfo.getExtendedAttributes();  
      gs.info(extendedAttributes["name1"]);
     }

     // get a jdbc connection in the ACME domain with the alias ID
     //      "cd5923ff9f03320021dd7501942e70bb"
     connectionInfo = provider.getConnectionInfoByDomain("cd5923ff9f03320021dd7501942e70bb",
            "c90d4b084a362312013398f051272c0d");
     if (connectionInfo != null) {
       // get data map
       var datamap = connectionInfo.getDataMap();
       gs.info(datamap["name"]);
     }

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

Selects connection information through the connection alias.
{#CIP-get-connection-infoprovider__table_afx_pp2_qbb__entry__3}

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

{#CIP-get-connection-infoprovider__table_afx_pp2_qbb}

## ConnectionInfoProvider - getConnectionInfo(String aliasID) {#ariaid-title3}

Retrieves a ConnectionInfo object identified by the given aliasID in the current
domain.
{#CIP-getConnectionInfo_S__table_xxn_xq2_qbb__entry__3}

| Name | Type | Description |
|-|-|-|
| aliasID | String | Sys_id of a connection alias. |
[Table 2. Parameters]

{#CIP-getConnectionInfo_S__table_xxn_xq2_qbb} {#CIP-getConnectionInfo_S__table_yxn_xq2_qbb__entry__2}

| Type | Description |
|-|-|
| ConnectionInfo | Information about the connection. |
[Table 3. Returns]

{#CIP-getConnectionInfo_S__table_yxn_xq2_qbb}  

    var provider = new sn_cc.ConnectionInfoProvider();

    // get a jdbc connection in the current domain with the alias ID
    //     "6219afbf9f03320021dd7501942e70fc"
    var connectionInfo = provider.getConnectionInfo("6219afbf9f03320021dd7501942e70fc");

## ConnectionInfoProvider - getConnectionInfoByDomain(String aliasID, String domainID) {#ariaid-title4}

Retrieves a ConnectionInfo object identified by the given aliasID for a specific
domain.
{#CIP-getConnectionInfoByDomain_S_S__table_xxn_xq2_qbb__entry__3}

| Name | Type | Description |
|-|-|-|
| aliasID | String | Sys_id of a connection alias. |
| domainID | String | Sys_id of a domain or <kbd class="ph userinput">global</kbd>. |
[Table 4. Parameters]

{#CIP-getConnectionInfoByDomain_S_S__table_xxn_xq2_qbb} {#CIP-getConnectionInfoByDomain_S_S__table_yxn_xq2_qbb__entry__2}

| Type | Description |
|-|-|
| ConnectionInfo | Connection information. |
[Table 5. Returns]

{#CIP-getConnectionInfoByDomain_S_S__table_yxn_xq2_qbb}  

    var provider = new sn_cc.ConnectionInfoProvider();

    // get a jdbc connection in the ACME domain with the alias ID
     //      "cd5923ff9f03320021dd7501942e70bb"
     connectionInfo = provider.getConnectionInfoByDomain("cd5923ff9f03320021dd7501942e70bb",
            "c90d4b084a362312013398f051272c0d");


