title: Google Sheets API: How to find a row by value and update it's content
body: <p>I am working on an Android application that uses a Google Spreadsheet as a database. 
  The application should GET, APPEND and UPDATE values in a spreadsheet, using the Sheets API v4. The first two functions are working fine but I have difficulties updating a specific row. I need to find a row that has a specific value in it's first column ("Batch ID") and update all the cells in this row.</p>
  
  <p>This is how my spreadsheet looks like.<img src="https://i.stack.imgur.com/6QCfa.jpg" alt=""></p>
  
  <p>Right now I am getting the row  to be modified like this:</p>
  
  <pre><code>ValueRange response = this.mySheetsService.spreadsheets().
                  values().get(spreadsheetId, range).execute();
  
  List&lt;List&lt;Object&gt;&gt; values = response.getValues();
  String rangeToUpdate;
  
  Log.i(TAG, "all values in range: " + values.toString());
  
  int i = 0;
  if (values != null) {
      for (List row : values) {
          i += 1;
          if (row.get(0).equals(selectedBatchID)) {
              Log.i(TAG, "IT'S A MATCH! i= " + i);
              rangeToUpdate = "A" + (i + 1) + ":E" + (i + 1); //row to be updated
          }
      }
  }
  /*once I have the row that needs to be updated, I construct my new ValueRange requestbody and
  *execute a values().update(spreadsheetId, rangeToUpdate , requestbody) request.
  */
  </code></pre>
  
  <p>This is actually working fine but I think it's an ugly solution and I am sure there is a better one out there.</p>
  
  <p>I have read the Sheets API documentation and I got familiar with notions such as <strong>batchUpdateByDataFilter</strong>, <strong>DataFilterValueRange</strong> or <strong>DeveloperMetadata</strong> and I sense that I should use these features for what I'm trying to achieve but I couldn't put them together and I couldn't find any examples.</p>
  
  <p>Can someone show me or help me understand how to use these Sheets V4 features?</p>
  
  <p>Thank you.</p>