title: How to integrate a loop into my code that will apply my request to every filterViewId?
body: <p>Currently encountering two problems with my code after executing:</p>
  
  <pre><code>API call to sheets.spreadsheets.batchUpdate failed with error: Invalid JSON payload received. 
  Unknown name "fields" at 'requests[0]': Cannot find field. 
  Invalid value at 'requests[0].update_filter_view.filter.filter_view_id' (TYPE_INT32), "*" (line 27, file "macros")
  </code></pre>
  
  <p>The first problem is that my request is not recognizing "fields" - I don't know why this is happening.</p>
  
  <p>The second issue, and the main reason for posting this is that filterViewId is looking for an integer when all I have referenced was "*" as a method to update all filter views in the sheet. How can I integrate a loop into my code so that it Gets the first filterViewId and applies the request and then moves on to the next?</p>
  
  <pre><code>function UpdateFilterView() {
      var sheets=SpreadsheetApp.getActiveSpreadsheet().getSheets();  
      for each (var dataSheet in sheets){ 
        var lastRow = dataSheet.getLastRow();
        var lastColumn = dataSheet.getLastColumn();
        var sheetId = dataSheet.getSheetId();
        var filterSettings = {
          "filterViewId": "*",
          "range":{
          "sheetId": sheetId,
          "startRowIndex": 0,
          "endRowIndex": lastRow,
          "startColumnIndex": 0,
          "endColumnIndex": lastColumn
          }
         }
        };
  
  
  var requests = [{
    "fields": "*",
    "updateFilterView":{
    "filter": filterSettings
    }
   }];
  
   Sheets.Spreadsheets.batchUpdate({"requests":requests},sheetId);
  
   }
  </code></pre>