Google Group Member List Retrieval

Retrieves Google Group members (email address) list. By checking group members (ML members) on a regular basis, ML management becomes easier. It also helps to prevent e-mail transmission to unnecessary members or to prevent lefting out proper members from information sharing.

    A. Set OAuth2 Config Name (at [OAuth 2.0 Setting])Single-line inputRequired
    B. Select STRING for Group Address (Non-existent Error)Data selectString(single line)Required
    C. Select STRING DATA for Email list of members (update)Data selectString(multiple line)Required
    X. Select STRING DATA for Access Log (update)Data selectString(multiple line)
    -variable namevariable label
    Aconf_OAuth2Set OAuth2 Config Name (at [OAuth 2.0 Setting])
    Bconf_DataIdBSelect STRING for Group Address (Non-existent Error)
    Cconf_DataIdCSelect STRING DATA for Email list of members (update)
    Xconf_DataIdXSelect STRING DATA for Access Log (update)
    // Google Group members retrieve via Admin SDK Directory API (ver. 20170710)
    // (c) 2017, Questetra, Inc. (the MIT License)
    
    //// == 工程コンフィグの参照 / Config Retrieving ==
    var oauth2  = configs.get( "conf_OAuth2" ) + "";
    var dataIdB = configs.get( "conf_DataIdB" ); // (returns key)
    var dataIdC = configs.get( "conf_DataIdC" ); // (returns key)
    var dataIdX = configs.get( "conf_DataIdX" ); // (returns key)
    
    //// == ワークフローデータの参照 / Data Retrieving ==
    var targetGroup = data.get( dataIdB ) + "";
    
    //// == 演算 / Calculating ==
    var membersEmail = "";
    var accessLog = "";
    var token = httpClient.getOAuth2Token( oauth2 );
    
    var uri = "https://www.googleapis.com/admin/directory/v1/groups/" + targetGroup + "/members/";
    var response = httpClient.begin()
      .bearer( token )
      .get( uri );
    var groupMembersObj = JSON.parse( response.getResponseAsString() );
    for( var i = 0; i < groupMembersObj.members.length; i++ ){
      membersEmail += groupMembersObj.members[i].email + "\n";
    }
    accessLog += "---GET request--- " + response.getStatusCode() + "\n";
    accessLog += response.getResponseAsString() + "\n";
    
    //// == ワークフローデータへの代入 / Data Updating ==
    retVal.put( dataIdC, membersEmail );
    if( dataIdX !== "" ){
      retVal.put( dataIdX, accessLog );
    }
    

    • B’: Email address in Google Group stored in Data Item selected at config B
    • Retrieves the member list of Google Group of B’ and stores in the Data Item selected at config C
    • The communication logs are stored in the data item selected at config X