• Resolved robertdiaz

    (@robertdiaz)


    Hello,

    I seem to be having an issue importing my CF7 form data into Google Sheets. When I copy and paste the function into the top cell in my Google Sheet, it briefly shows “Loading…” and then returns the number 0;

    I get the same result with the “Hide credentials” checkbox checked/unchecked.

    I am able to download the .CSV when I click the export link.

    I looked through some older forum posts and wonder if there’s a security setting in my web host that could be causing this. Or is there a setting in the plugin options that I can change? Any ideas?

    Thanks for your time and input 🙂

    https://wordpress.org/plugins/contact-form-7-to-database-extension/

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

    (@msimpson)

    If your WP has a login page that requires a human to input a value, like it gives you a simply math equation or something like that, then the Google SS will not be able to login to your site to download the data. Or there could be something else wrong.

    Trying to debug: instead of using IMPORTDATA, you can add a user-created function to do the same thing. The advantage is that it may give you an error message.

    What you will put in your cell is:
    =cfdbdata(“http://YOUR-SITE”, “FORM-NAME”, “USER”, “PASSWORD”)

    Follow the instruction at:
    http://YOUR-SITE/wp-admin/admin-ajax.php?action=cfdb-export&enc=GLD&form=FORM-NAME

    Thread Starter robertdiaz

    (@robertdiaz)

    Thanks Michael, following these steps did the trick!!

    Do you know if there is a way to modify the script to use the encrypted version of the username/password (provided in the Shortcode section of the plugin)?

    The odd thing is that my site initially used a math equation verifier on the log in page. I don’t remember removing it, so I’m curious if one of the previous WP upgrades made changes to wp-login.

    In any case, thanks again 🙂

    Plugin Author Michael Simpson

    (@msimpson)

    The cfdbdata() function doesn’t take the obfuscated login/password.

    I haven’t tried it, but here is version that might work. You give that obfuscated login/password (generated in the Short Code Builder page) for the login parameter.

    I named it cfdbdata2 so you can have both cfdbdata and cfdbdata2 defined.

    function cfdbdata2(site_url, form_name, login, /*, [option_name, option_value] ... */) {
        var param_array = [];
        param_array.push("action=cfdb-login");
        param_array.push("username=" + encodeURI(user));
        param_array.push("l=" + encodeURI(login));
        param_array.push("cfdb-action=cfdb-export");
        param_array.push("enc=JSON");
        param_array.push("format=array");
        param_array.push("form=" + encodeURI(form_name));
    
        var args = arg_slice(arguments, 2);
        args = process_name_value_args(args);
        param_array = param_array.concat(args);
    
        return fetch_json_url(site_url, param_array);
    }
    Thread Starter robertdiaz

    (@robertdiaz)

    No luck, it’s giving me this error: ReferenceError: “user” is not defined.

    Plugin Author Michael Simpson

    (@msimpson)

    Whoops…remove that line:

    function cfdbdata2(site_url, form_name, login, /*, [option_name, option_value] ... */) {
        var param_array = [];
        param_array.push("action=cfdb-login");
        param_array.push("l=" + encodeURI(login));
        param_array.push("cfdb-action=cfdb-export");
        param_array.push("enc=JSON");
        param_array.push("format=array");
        param_array.push("form=" + encodeURI(form_name));
    
        var args = arg_slice(arguments, 2);
        args = process_name_value_args(args);
        param_array = param_array.concat(args);
    
        return fetch_json_url(site_url, param_array);
    }

    Thread Starter robertdiaz

    (@robertdiaz)

    That was it — it’s working lovely now!!

    Thanks again Michael!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Google SS Live Data export returns '0' in Google Sheets’ is closed to new replies.