2

I inherited a monster sheet that is pretty much constantly used by multiple persons. It contains several filter views.

Is there any way to find out what exactly each filter view does without manually going to the filter view and then checking each column for conditions present? This sheet has over 50 columns, so doing this manually is a royal pita. Editing them is as well. The filter views include things like filtering by colors, filtering by meeting cell content conditions and possibly other things.

1

1 Answer 1

1

You can list filter views with the Sheets API Explorer. Paste the spreadsheet ID in the spreadsheetId field and click Execute. You can find the spreadsheet ID in the web browser address bar — it is the bit between /d/ and /edit.

The response shows filter views in this format:

      "filterViews": [
        {
          "filterViewId": 336145647,
          "title": "Show all",
          "range": {
            "sheetId": 2048818001,
            "startRowIndex": 1,
            "endRowIndex": 200,
            "startColumnIndex": 3,
            "endColumnIndex": 4
          }
        },
        {
          "filterViewId": 1676824153,
          "title": "AJC",
          "range": {
            "sheetId": 2048818001,
            "startRowIndex": 1,
            "endRowIndex": 200,
            "startColumnIndex": 3,
            "endColumnIndex": 4
          },
          "criteria": {
            "3": {
              "hiddenValues": [
                "NDT",
                "",
                "ASG",
                "DED",
                "KDG",
                "LH",
                "WBV",
                "WGC"
              ]
            }
          },
          "filterSpecs": [
            {
              "columnIndex": 3,
              "filterCriteria": {
                "hiddenValues": [
                  "NDT",
                  "",
                  "ASG",
                  "DED",
                  "KDG",
                  "LH",
                  "WBV",
                  "WGC"
                ]
              }
            }
          ]
        },
        ...

The response will include many other items as well. To get just the filter views programmatically, use the spreadsheets.get method and set the fields URL parameter to sheets/filterViews as shown in the documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.