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

112
Vistas
How to modify the rows of a DataTable using the array values in google apps script?
  function drawChart() {
        var data = new google.visualization.DataTable();
        
        data.addColumn('string', 'From');
        data.addColumn('string', 'To');
        data.addColumn('number', 'number of calls');
        data.addRows([
          [ 'calls', 'X', 5 ],
          [ 'calls', 'A', 7 ],
          [ 'calls', 'B', 6 ],
          [ 'calls', 'C', 2 ],
          [ 'calls', 'D', 9 ],
          [ 'calls', 'E', 4 ]
        ]);

The above is just a portion of an HTML code that I would like to modify the data.addRows([]) by using the array values. It seems not practical to hardcode the rows, so I believe there is a simple workaround for this. For example I have a range values in google sheet, var values=Spreadsheet.getActive().getSheetByName('sheet1').getRange("A1:C6"). I tried to use data.addRows(values) but its not working. I am new to apps script coding and I don't know where to insert my code var values=Spreadsheet.getActive().getSheetByName('sheet1').getRange("A1:D5") to be usable in that HTML code above dataTable. Please help.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try using:

var values=Spreadsheet.getActive().getSheetByName('sheet1').getRange("A1:D5").getValues();

data.addRows(values);
about 4 years ago · Juan Pablo Isaza Denunciar
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