---
sourceDocument: オーストラリア API リファレンス
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/api-reference

 Release :

    - australia

ft:locale :

    - ja-JP

ft:publication_title :

    - オーストラリア API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ConnectionInfo - スコープ対象、グローバル

# ConnectionInfo - スコープ対象、グローバル {#ariaid-title1}

* リリースバージョン: Australia
* 
* 更新日 2026年03月12日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：4分

ConnectionInfo API を使用すると、接続および資格情報エイリアスを介して接続属性情報を取得できます。

この API は、スコープ対象のアプリケーションまたはグローバルスコープ内で使用できます。スコープ付きスクリプトでは、 `sn_cc` 名前空間識別子を使用します。

接続と資格情報の詳細については、「 [資格情報と接続情報](https://www.servicenow.com/docs/access?context=r-credentials&version=australia&pubname=australia-platform-security&ft:locale=en-US)」を参照してください。

この関数は、指定された接続および資格情報エイリアスによって識別される接続属性情報を取得します。  

    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"]);
     }

## スコープ付き ConnectionInfo:getAttribute(文字列名) {#ariaid-title2}

指定したプロパティ名を持つ ConnectionInfo 属性の値を返します。
{#CI-getAttribute_S__table_ext_cx2_qbb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| name | 文字列 | ConnectionInfo オブジェクトプロパティの名前。 |
[表 : 1. パラメーター]

{#CI-getAttribute_S__table_ext_cx2_qbb} {#CI-getAttribute_S__table_fxt_cx2_qbb__entry__2}

| タイプ | 説明 |
|-|-|
| 文字列 | 指定された ConnectionInfo プロパティの値。 |
[表 : 2. 返される内容]

{#CI-getAttribute_S__table_fxt_cx2_qbb}  

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

## スコープ付き ConnectionInfo:getCredentialAttribute() {#ariaid-title3}

指定された接続の認証情報属性の値を返します。
{#CI-getCredentialAttribute_S__table_ext_cx2_qbb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 3. パラメーター]

{#CI-getCredentialAttribute_S__table_ext_cx2_qbb} {#CI-getCredentialAttribute_S__table_fxt_cx2_qbb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | 認証情報属性のキーと値のペアマップ。 |
[表 : 4. 返される内容]

{#CI-getCredentialAttribute_S__table_fxt_cx2_qbb}  

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

## スコープ付き ConnectionInfo - getDataMap() {#ariaid-title4}

キーと値のペアのコレクションとして接続属性を返します。
{#CI-getDataMap_S__table_ext_cx2_qbb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 5. パラメーター]

{#CI-getDataMap_S__table_ext_cx2_qbb} {#CI-getDataMap_S__table_fxt_cx2_qbb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | 接続属性のキーと値のペアマップ。 |
[表 : 6. 返される内容]

{#CI-getDataMap_S__table_fxt_cx2_qbb}  

     // get data map
      var datamap = connectionInfo.getDataMap();
      gs.info(datamap["name"]);
      gs.info(datamap["connection_url"]);

## スコープ付き ConnectionInfo:getExtendedAttributes() {#ariaid-title5}

拡張属性をキーと値のペアのコレクションとして返します。
{#CI-getExtendedAttributes_S__table_ext_cx2_qbb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 7. パラメーター]

{#CI-getExtendedAttributes_S__table_ext_cx2_qbb} {#CI-getExtendedAttributes_S__table_fxt_cx2_qbb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | 拡張属性のキーと値のペアマップ。 |
[表 : 8. 返される内容]

{#CI-getExtendedAttributes_S__table_fxt_cx2_qbb}  

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


