Thursday, December 11, 2008

Google API SpreadsheetQuery doesnt work with at symbol (@)

I hate wasting time on stupid issues... and this was one of them. For the life of me, I couldn't figure out why I could not return a ListEntry when I was searching with an email address.

Problem:
ListQuery Lquery = new ListQuery(listFeedLink.HRef.ToString());
Lquery.SpreadsheetQuery = "user@google.com";

Solution:
ListQuery Lquery = new ListQuery(listFeedLink.HRef.ToString());
Lquery.SpreadsheetQuery = "\"user@google.com\"";


I figured it probably had something to do with the string delimiter, but the odd thing was that the google service would accept the full email address without throwing an error and just return no results. (Probably a bug) Regardless, it is still good to know that the string delimiter for the SpreadsheetQuery is a quotation mark since it isn't well documented.

No comments: