Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

621
Vistas
Google App Script: Get values filtered by a slicer

Is there a way to get a range of values filtered by a slicer/multiple slicers using App Script? My understanding is that slicers work like a filter view which are not "hard" filters. I tried .getRange().getValues() but it returns all the data without the slicers being applied.

I have a source data in one sheet and a pivot table with slicers in another sheet. I want the user to open the sheet with the pivot table, filter the table using the slicers and then run a script which would get the filtered range from the table.

Using the below code I see that the script gets all the data even when the slicers are applied:

 var activeSheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
 var vals = activeSheet.getRange("A2:A").getValues();
 var numOfResults = vals.filter(String).length;
 Logger.log(numOfResults);

Test sheet: https://docs.google.com/spreadsheets/d/1pmazwEQp37Dkz41X2EjHmHEpONKqBD4g-Zhq0KuBYdU/edit?usp=sharing

Thanks a lot for any help!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda