• Resolved greenemnl

    (@greenemnl)


    Dear all,

    I’ve been trying to get Google Live data to work using the generated Google Spreadsheet Function, but unfortunately without succes.

    I’ve followed the instructions as outlined, inserted my WordPress password into the call, copy/pasted these lines of code in the Google Doc’s script editor, but whenever I call the function from an Spreadsheet I get an error:
    ‘Error: SyntaxError: Unexpected token: ? (line 79).’

    If I run the script directly in the script editor, it says:
    ‘SyntaxError: Empty JSON string (line 79, file “Code”).’

    The WordPress user has administrative rights, so should not have permission issues.

    Does anyone have an idea what is going wrong here?

    Many regards,
    Gijs

    https://www.ads-software.com/plugins/contact-form-7-to-database-extension/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    Do you need to use that code? In the recent versions of the plugin, you create a Google Live Data export from the short code builder page and it gives you a formula but you don’t need the extra code. But there are some cases when it will ask you to use the code still. I want to verify that you actually need the code first.

    Thread Starter greenemnl

    (@greenemnl)

    Hi Michael,
    That was quick!

    I am using the latest version of the plugin: 2.8.22.

    I am a bit confused: in the export and shortcode builder, I’ve selected ‘Google Spreadsheet Live Data’. When using a limited set of variables, the URL in Google Spreadsheet works. When the generated URL became too long (due to the selection of columns and such), you see the function that Google Spreadsheet calls for. This function is:
    ‘=cfdbdata(“https://www.zonnigzeker.nl&#8221;, “Aanmeldformulier particulieren huishoudens – Zonnig Zeker Bunschoten”, “<login>”, “<password>”, “show”, “Submitted,aanhef,naam,postcode,huisnummer,contact-email,telefoonnummer,extrainformatie,verbruik,typedak,type_gebruiker,akkoord,Submitted Login,Submitted From,submit_time”)’

    Per the instructions, I’ve changed the <login> and <password> in the function, and followed the instructions. In these instructions, I says to copy/paste the ensuing script file into the script editor.

    Hope this makes sense…

    Plugin Author Michael Simpson

    (@msimpson)

    That’s correct. I just wanted to be sure this was not generated from an older version.

    What you have looks right. I think what is happening is the login is failing (check the username/password). The error on line 79 is:

    return JSON.parse(content);

    where the code is trying to read what is returned from the WP site as JSON formatted text. But it errors because it is not JSON. Instead it is probably an error message.

    Thread Starter greenemnl

    (@greenemnl)

    Again, thanks for your quick reply.

    Hmm. ok. Ive checked the following possibilities:
    -doublechecked the login credentials
    -doublechecked that the url prefix is correct (i.e. https://www.)
    -changed the credentials to only include letters
    -logged out of WordPress, and refreshed the sheet
    -made sure the appropriate credentials have administrative rights.
    -changed the name of the form to make sure it didn’t contain spaces or special characters.

    But the exact same error persists.

    Is there a way to see the error message in question? Perhaps there is something there to further help…

    Regards,
    Gijs

    Plugin Author Michael Simpson

    (@msimpson)

    In the code change:

    return JSON.parse(content);

    to:

    //return JSON.parse(content);
      return content;

    and the error text should display in the cell

    Thread Starter greenemnl

    (@greenemnl)

    Many thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Contact Form DB] Unable to get Google Live data to work’ is closed to new replies.