Support » Plugin: Inline Google Spreadsheet Viewer » AND and quotes in a query

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Meitar

    (@meitar)

    Google processes the query. This plugin simply passes the query along to Google as a URL, so all operators Google supports are supported here, too.

    As for nested quotes, as long as you avoid confusing the WordPress parser, you should be fine. One way to avoid confusing the parser is to URL-encode your quotes.

    Also, you can use the gdoc_query filter to inspect what the query value is after WordPress parses the shortcode.

    Is there any chance you could take a look at what I posted here: http://webapps.stackexchange.com/questions/76218/google-query-for-dates-in-last-30-days

    It details the versions I’ve tried – I can’t get this to work for anything!

    Plugin Author Meitar

    (@meitar)

    Two things.

    First, just to clarify, if you’re using any character that confuses the WordPress parser, such as arrow brackets (< or >, for instance) you need to URL-escape those characters in the shortcode so that WordPress will pass the full shortcode and its attribute and values correctly to the plugin to handle. See the very last FAQ entry, headlined “Why am I getting errors when I try to use the query attribute?”

    Second, it seems to me like you’re going about this in a way more complicated fashion than necessary. If I understand your question on Stack Exchange question correctly, all you need to do is retrieve a subset of data, but you’re trying to generate that subset as part of a query in the retrieval URL. You can do this, but as you’re finding out, it’s unnecessarily complicated.

    If you have edit access to the spreadsheet itself, you should instead consider creating a new column/sheet/etc. in the spreadsheet proper using Google Spreadsheets’s QUERY() function like the first answer suggests that is a subset of your data (in this case, rows whose date is within the last 30 days), and then use this plugin simply to call the appropriate ranges/sheets for the subset you’re interested in, as you’ve already been able to successfully do.

    Note in particular that the shortcode’s query attribute simply passes along its value to the retrieval URL as described here, whereas a =QUERY() formula inside a Google Spreadsheet is a proper Google Sheets function. These two things of similar names do not offer the same functionality.

    You are a genius! I didn’t even think of that. Yes – I set up a new spreadsheet in Google, added the Google Query to sort by date. Then, I was able to use my exact same shortcode against the new sheet. Thank you so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘AND and quotes in a query’ is closed to new replies.