The problem is the fact that each column has an id, and a label.
When the data source is Google Spreadsheets, the ids are the column letters
(A, B, C, ...all caps).
The labels are the titles you set in the headers.
The reason for this, is that headers are optional, and you want to always
have ids, to enable queries).
So in your case, changing MemberName to B will do the trick.

A tip, if we are already there: If you want to use the public version of the
spreadsheet and not the live data, change the url to pub( instead of ccc),
and make sure that it is public (of course do it only if you have no privacy
issues).
The advantage are better performance, and the cost, out of privacy, is that
you might have 5 minutes delay for the data to be refresshed.

Regards,
VizGuy



On Sat, Jan 3, 2009 at 1:23 AM, kneelt <[email protected]> wrote:

>
> Today I took my first stab at creating a Google Gadget that pulls data
> from a Google Docs spreadsheet.
>
> After flailing about for quite some time, I finally got something to
> work based on some sample code from
> http://code.google.com/apis/spreadsheets/spreadsheet_gadgets.html
>
> Putting my new knowledge to the test, I thought I should be able to
> set my query inside the code instead of pulling the entire spreadsheet
> based on the URL that I'd been setting in the gadget properties.  As
> shown in the code scrap below, I commented out the line of code that
> gets the URL from the UserPrefs.  Then in accordance with:
>
>
> http://code.google.com/apis/visualization/documentation/querylanguage.html#Setting_the_Query_from_JavaScript
>
> I used the next two lines to define the source table and the query.
>
> //  var query = gadgetHelper.createQueryFromPrefs(prefs);
>  var query = new google.visualization.Query("http://
> spreadsheets.google.com/a/azbikeclub.org/ccc?
> key=pcgG03qqMcz39cWkgDGUzPg&hl=en<http://spreadsheets.google.com/a/azbikeclub.org/ccc?key=pcgG03qqMcz39cWkgDGUzPg&hl=en>
> ");
>  query.setQuery('select MemberName order by MemberName');
>  query.send(handleQueryResponse);
>
> When the gadget runs, it says:
>
> Invalid query
> Column [MemberName] does not exist in table
>
> There is indeed a column named "MemberName" in the spreadsheet.  How
> come I can't select and sort on that column?  Thanks.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to