So I do a query to a Google Sheet as Below but I get the whole column.

How can I get a particular value of that query?

Let's said that I'm queering this table:

Name    Last Name    Age
John      Smith           26

After I execute the query SELECT B, C WHERE A = John

I would like to introduce in a variable the values  Smith and 26.

something like:

var LastName = query [1,1]
var Age =  = query [1,2]

This is what I tried so fat and didn't work:

var Area = query[0].value;
var Area = query[0];
var Area = query[1,1].value;
var Area = query[1,1];

Code below.

     var dataSourceUrl = 
'https://docs.google.com/spreadsheets/d/1xfb9trifQA5KDPc9Nh5hBL4MJ290Mxcc1Uod2VTPzYI'
;
     var magicIncantation = '/gviz/tq?sheet=Sheet1&headers=1&tq=';


      var queryStringInfo = encodeURIComponent("SELECT C WHERE A = 
'Alabama'");
      query = new google.visualization.Query(dataSourceUrl + 
magicIncantation + queryStringInfo);
      var Area = query[0].value;
      var Area2 = query[1].value;
      var Area3 = query[1,1].value;

*THANK YOU SO MUCH!!!!*

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/572d7d5f-8bba-43f9-b2f9-9d5d5ec70e60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to