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

    (@meitar)

    Unfortunately, the query attribute is only available for “new” style Google Sheets. Your shortcode is accessing an “old” style Google Spreadsheet. Consider moving your spreadsheet to the new Google Sheets and then trying again?

    Thread Starter tfwalsh

    (@tfwalsh)

    Thank you for your response. I did move to NEW google sheets but am still unable to make the code work.
    here’s my code now, but it give an error:

    [gdoc key=”https://docs.google.com/spreadsheets/d/1RdXh5SrdQTidv7arsGFEUppLOm96SOZ5rb8YsoycGuY/edit” use_cache=”no” query=”SELECT Pedido ou agradecimento, Timestamp order by Timestamp desc”]

    Thread Starter tfwalsh

    (@tfwalsh)

    more info:
    if i remove the query=”SELECT…..” all is good; like this:
    [gdoc key=”https://docs.google.com/spreadsheets/d/1RdXh5SrdQTidv7arsGFEUppLOm96SOZ5rb8YsoycGuY/edit” class=”no-datatables” use_cache=”no”]

    Plugin Author Meitar

    (@meitar)

    What was the error you got?

    Also, with Google Spreadsheets, I’ve found that it’s more reliable to simply use the column letter (what Google calls the “column identifier”). For your spreadsheet, I think that means you can use a query like this:

    SELECT C, A order by A desc

    Column C is the third column (Pedido ou agradecimento) and column A is the first column (Timestamp). I tried a shortcode like this:

    [gdoc key="https://docs.google.com/spreadsheets/d/1RdXh5SrdQTidv7arsGFEUppLOm96SOZ5rb8YsoycGuY/edit" class="no-datatables" use_cache="no" query="SELECT C, A order by A desc"]

    and this worked for me.

    Also note that since your column names have spaces in them, you need to surround those column names with backquotes if you want to use them in a Google Query Language query. See the Query Language reference for documentation about this:

    In the following example, back-quotes are used to reference column ids that contain spaces (email address) or that are reserved words (date):

    select `email address`, name, `date`
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘select columns’ is closed to new replies.