Searching for a number with an ampersand

27 views
Skip to first unread message

Robert Adams

unread,
Mar 16, 2018, 5:09:28 PM3/16/18
to Google Visualization API
I have successfully searched, using visualization API coupled with javascript, my google spreadsheet and returned expected results
My issue now is I am searching a row of numbers with an ampersand in it. The number reads like so: S&D01234

I have tried two methods to search for the number;

1.) using encodeURIComponent
2.) replace & with the unicode - U+0026

there is now error with either of these methods, but it returns headers only with no data.

I also alerted the value of my var in both cases, they were:

1.) S%26D01234
portion of the rendered URL: SELECT+A,+B,+C,+D,+E,+F,+G,+H,+I,+J+WHERE+F+CONTAINS+%27S%26D01234%27&gid=0
2.) SU+0026D01234
portion of the rendered URL: SELECT+A,+B,+C,+D,+E,+F,+G,+H,+I,+J+WHERE+F+CONTAINS+%27SU+0026D01234%27&gid=0

Neither works. 

Any ideas?

Robert

Robert Adams

unread,
Mar 20, 2018, 4:18:35 PM3/20/18
to Google Visualization API
Well, I ended up altering the actual data which now reads SD01234, but even the basic pull out all data removes the SD01234 from the cell before returning the results.

Any help?

Robert

Robert Adams

unread,
Mar 20, 2018, 8:29:37 PM3/20/18
to Google Visualization API
Figured it out, Format the column to be text. Now the search works!

Thanks, me!


On Friday, March 16, 2018 at 2:09:28 PM UTC-7, Robert Adams wrote:
Reply all
Reply to author
Forward
0 new messages