Google Sheets Batch acquisition of Two rows data

Stores the value in two columns of the specified Google Sheets into a data item, and stores its communication log in a String type data item

    A. Set OAuth2 Config Name (at [OAuth 2.0 Setting])Single-line inputRequired
    B. Select STRING/SELECT for Spreadsheet ID (Non-existent Error)Data selectString(single line)orSelect(radio/select/search)Required
    C. Select STRING/SELECT for Sheet Title (Non-existent Error)Data selectString(single line)orSelect(radio/select/search)Required
    D. Select STRING/SELECT for a Range of Choice-IDs (e.g. "A1:A")Data selectString(single line)orSelect(radio/select/search)Required
    E. Select STRING/SELECT for a Range of Labels (e.g. "D2:D")Data selectString(single line)orSelect(radio/select/search)Required
    F. Select STRING DATA for Choise-IDs (update)Data selectString(multiple line)Required
    G. Select STRING DATA for Labels (update)Data selectString(multiple line)Required
    H. 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/SELECT for Spreadsheet ID (Non-existent Error)
    Cconf_DataIdCSelect STRING/SELECT for Sheet Title (Non-existent Error)
    Dconf_DataIdDSelect STRING/SELECT for a Range of Choice-IDs (e.g. "A1:A")
    Econf_DataIdESelect STRING/SELECT for a Range of Labels (e.g. "D2:D")
    Fconf_DataIdFSelect STRING DATA for Choise-IDs (update)
    Gconf_DataIdGSelect STRING DATA for Labels (update)
    Hconf_DataIdHSelect STRING DATA for Access Log (update)
    // Batch to Get Data via Google Sheets API (ver. 20160921)
    // (c) 2016, Questetra, Inc. (the MIT License)
    
    // OAuth2 config
    // Authorization Endpoint URL: https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force
    // Token Endpoint URL: https://accounts.google.com/o/oauth2/token
    // Scope: https://www.googleapis.com/auth/spreadsheets
    // Consumer Key: (Get by Google Developers Console)
    // Consumer Secret: (Get by Google Developers Console)
    
    //// == 工程コンフィグの参照 / Config Retrieving ==
    var oauth2 = configs.get( "conf_OAuth2" );
    var dataIdB = configs.get( "conf_DataIdB" ); // (returns Number)
    var dataIdC = configs.get( "conf_DataIdC" ); // (returns Number)
    var dataIdD = configs.get( "conf_DataIdD" ); // (returns Number)
    var dataIdE = configs.get( "conf_DataIdE" ); // (returns Number)
    var dataIdF = configs.get( "conf_DataIdF" ); // (returns Number)
    var dataIdG = configs.get( "conf_DataIdG" ); // (returns Number)
    var dataIdH = configs.get( "conf_DataIdH" ) + ""; // (returns Number)
    
    //// == ワークフローデータの参照 / Data Retrieving ==
    var docId = "";
    if( data.get( dataIdB ) instanceof java.util.ArrayList ){
      docId = data.get( dataIdB ).get(0).getValue() + "";
    }else if( data.get( dataIdB ) instanceof java.lang.String ){
      docId = data.get( dataIdB ) + "";
    }
    var sheet = "";
    if( data.get( dataIdC ) instanceof java.util.ArrayList ){
      sheet = data.get( dataIdC ).get(0).getValue() + "";
    }else if( data.get( dataIdC ) instanceof java.lang.String ){
      sheet = data.get( dataIdC ) + "";
    }
    var rangeI = "";
    if( data.get( dataIdD ) instanceof java.util.ArrayList ){
      rangeI = data.get( dataIdD ).get(0).getValue() + "";
    }else if( data.get( dataIdD ) instanceof java.lang.String ){
      rangeI = data.get( dataIdD ) + "";
    }
    var rangeL = "";
    if( data.get( dataIdE ) instanceof java.util.ArrayList ){
      rangeL = data.get( dataIdE ).get(0).getValue() + "";
    }else if( data.get( dataIdE ) instanceof java.lang.String ){
      rangeL = data.get( dataIdE ) + "";
    }
    
    //// == 演算 / Calculating ==
    var accessLog = "";
    var responseJson = "";
    var token = httpClient.getOAuth2Token( oauth2 );
    
    var choiseIds = "";
    var choiseLabels = "";
    
    try{
      // Method: spreadsheets.values.batchGet
      var uri = "https://sheets.googleapis.com/v4/spreadsheets/";
      uri += docId;
      uri += "/values/:batchGet";
    
      var response = httpClient.begin()
        .bearer(token)
        .queryParam( "ranges", sheet + "!" + rangeI )
        .queryParam( "ranges", sheet + "!" + rangeL )
        .queryParam( "valueRenderOption", "UNFORMATTED_VALUE" )
        .queryParam( "majorDimension", "COLUMNS" )
        .get( uri ); 
      accessLog += "---GET request--- " + response.getStatusCode() + "\n";
      responseJson = response.getResponseAsString();
      if( response.getStatusCode() == 200 ){
        var jsonObj = JSON.parse( responseJson );
        for( var i = 0; i < jsonObj.valueRanges[0].values[0].length; i++ ){
          choiseIds += jsonObj.valueRanges[0].values[0][i] + "\n";
          choiseLabels += jsonObj.valueRanges[1].values[0][i] + "\n";
        }
      }
    }catch(e){
      accessLog += e.message + "\n";
    }
    // for Debug
    // accessLog += responseJson + "\n";
    
    //// == ワークフローデータへの代入 / Data Updating ==
    retVal.put( dataIdF, choiseIds );
    retVal.put( dataIdG, choiseLabels );
    if( dataIdH !== "" ){
      retVal.put( dataIdH, accessLog );
    }
    

    • B’: Google Spreadsheet ID ** stored in the Data Item selected at config B
    • C’: Sheet Title stored in the Data Item selected at config C
    • D’: Strings * for specifying Cell range in the Data Item selected at config D
    • E’: Strings * for specifying Cell range in the Data Item selected at config E
    • The values in the areas D ‘and E’ in Sheet C ‘of Spreadsheet B’ are respectively stored in the Data Items selected at config F and G
    • The communication logs are stored in the data item selected at config H
    • It is premise that the number of values in range D’ and E’ are the same, and there is no empty cell in the middle of the range
    • * Specify “A: A” for all cells in row A, “A2: A” for rows of the second and after, and “A1: A100” for rows 1 to 100 in column A (Reference: A1 notation)
    • ** https://docs.google.com/spreadsheets/d/1exampleEXAMPLEexampleEXAMPLEexampleEXAMPLE0/edit#gid=0