Search code examples
javascripthtmlvisualizationgoogle-fusion-tables

How to get the number of rows results using queryText in a fusion table?


How to get the number of rows results using queryText in a fusion table? I will post my code below...

function drawTable() 
{
    var queryText = encodeURIComponent(consulta);
    var gvizQuery = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq=' + queryText);
    gvizQuery.send(function (response) 
    {
        var table = new google.visualization.Table(document.getElementById('visualization'));
        table.draw(response.getDataTable(), { showRowNumber: true });
    });
}

Solution

  • numRows = response.getDataTable().getNumberOfRows();