Hello,
I am having a hard time getting the right way to escape quotes AND double
quotes at the same when using the google.visualization.Query and the where
clause.
I keep on getting the error :
Error in query: Invalid query Query parse error: Encountered "
>> <UNEXPECTED_CHAR> "\' "" at line 1, column 42.
>
> Was expecting one of:
>
> "," ...
>
> ")" ...
>
> "*" ...
>
> "+" ...
>
> "-" ...
>
> "/" ...
>
> "%" ...
>
> "*" ...
>
> "/" ...
>
> "%" ...
>
> "+" ...
>
> "-" ...
>
> "," ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> ")" ...
>
> "*" ...
>
> "/" ...
>
> "%" ...
>
> "+" ...
>
> "-" ...
>
>
This is how the call is made for the moment and the problem comes from the
filter
parameter which can contain quotes and/or double quotes :
filter = encodeURIComponent(filter);
filter = encodeURI(filter);
>
new
> google.visualization.Query("https://spreadsheets.google.com/a/"+domain+"/tq?key="+key+"&headers=1&range="+range+"&sheet="+sheet+"&tq=select%20*%20where%20lower("+searchColumn+")%20contains%20lower('"+filter+"')");
or without the lower function on filter :
> filter = encodeURIComponent(filter);
filter = encodeURI(filter);
filter.toLowerCase();
new
> google.visualization.Query("https://spreadsheets.google.com/a/"+domain+"/tq?key="+key+"&headers=1&range="+range+"&sheet="+sheet+"&tq=select%20*%20where%20lower("+searchColumn+")%20contains%20'"+filter+"'");
I've been trying to figure out the right way to either
use encodeURIComponent/encodeURI for example. The question seems so simple
that I feel like I am missing something quite obvious.
Thank you in advance for any help.
Lynn
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.