title: How to turn on basic filter using google sheets api and still see all values?
body: <p>I managed to write an R function using google sheets api's 'setBasicFilter' that turns on the basic filter on the cell range specified by the user. However, when the user tries to 'Filter by values', no values appear to be selected. </p>
  
  <p>The function seems to work fine in the sense that the green filter arrow (or button at the right side of the cells you are using to filter) turn on in the sheets (tabs) and cell range that I want. What I do not understand is why when I click on it, it appears as if there were no values in the column to filter by. It is completely blank but there is data on the column! </p>
  
  <p>I thought perhaps it was setting a filter on top of a filter and tried using 'clearBasicFilter' first before sending 'setBasicFilter' and it did not work.</p>
  
  <p>I tried writing data to the sheet and then turning on the filter and, vice versa, turning on the filter and then writing the data. Still appears as if there were no values to filter by (although the data is there).</p>
  
  <p>In essence, what I am trying to achieve is, when writing data to a sheet:</p>
  
  <ol>
  <li>Remove any basic filter present.</li>
  <li>Write the data.</li>
  <li>Turn the filter buttons back on (within the range specified by the user of the function).</li>
  </ol>
  
  <p>Here is what my call looks like:</p>
  
  <pre><code># for each row in the param table create a json body
  for(row in nrow(param)){
  
  body &lt;- paste0('{"requests": [
    {
      "setBasicFilter": {
        "filter": {
          "range":{"sheetId": ', param$sheetId,
                 ', "startRowIndex": ', param$startRow,
                 ', "endRowIndex": ', param$endRow,
                 ', "startColumnIndex": ', param$startCol,
                 ', "endColumnIndex": ', param$endCol,
                 '}}}}]}')
   }
  </code></pre>
  
  <p>Where the param table looks like this (and is created based on the users' inputs to the function:</p>
  
  <pre><code>|sheetName |startRow |endRow |startCol |endCol |sheetId     |
  |:---------|:--------|:------|:--------|:------|:-----------|
  |Sheet1    |1        |0      |0        |11     |someId      |
  |Sheet2    |0        |0      |0        |11     |someOtherId |
  </code></pre>
  
  <p>Multiple json bodies are created and then I lapply the call using google's batchUpdate method. </p>
  
  <p>I do not get any errors and the filter turns on where I need it to be. I would like to be able to:</p>
  
  <ol>
  <li>Go to the sheet I just turned the filter on</li>
  <li>Click on the green filter arrow (which will already be in the cell range I specified)</li>
  <li>And see the list of all possible values I can filter that column by</li>
  </ol>
  
  <p>I am sorry for such a long description. I was trying to be as specific as possible.</p>