How to get information from merged cell in Google Sheets API

3 weeks ago 18
ARTICLE AD BOX

I have a problem. I need to get info from merged cell, but this information only on first cell of this merged cell.
F.e. I get request for cells C2:C3. But C3 is a part of merged cell A3:C3. How I need to get correct information from this cell?
I didn't find any information on the Internet. Please help

This is my code for getting cells:

public List<List<Object>> getAllGroups() { try { final NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport(); final String range = "C2:C3"; Sheets service = new Sheets.Builder(HTTP_TRANSPORT, JSON_FACTORY, getCredentials(HTTP_TRANSPORT)) .setApplicationName(APPLICATION_NAME) .build(); ValueRange response = service.spreadsheets().values() .get(spreadsheetId, range) .execute(); return response.getValues(); } catch (GeneralSecurityException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } }
Read Entire Article