Google Sheet API - Button Does Nothing

I have been working on this for a good amount of time now. I have followed these instructions with setting up the Google Cloud Platform.
Copied backend code and sheetId to the Secrets Manager.

Added the JSW, the Google-Sheets-Integration and the GoogleApis NPM

Got the code and the elements in my page.

Originally, I was getting an error when I would click the getButton. I realized that instead of just the SheetID, I had the full URL to the Sheet.

Now I have the Sheet Id only in the SheetId Secret and the button does absolutely nothing. I do not even get a log line for an event.

The 2 things I was toying with was

  1. Does it have something to do with OAuth?
  2. Does it have something to do with permissions or owner of the Google Sheet itself?

This is in my page

import { getValuesWrapper } from 'backend/googlesheet-wrapper.jsw';

$w.onReady(function () {
    registerHandlers();
});

function registerHandlers() {
    $w('#getButton').onClick(() => getValuesFromSheet());
}

async function getValuesFromSheet() {
    try {
        const [name, email] = (await getValuesWrapper('A1:B1'))[0];
        $w('#nameOutput').value = name;
        $w('#emailOutput').value = email;
    } catch (err) {
        showMessage(err.toString());
    }
}

function showMessage(msg) {
    $w('#showMsg').text = msg;
    $w('#showMsg').expand()
    setTimeout(() => {
        $w('#showMsg').collapse();
    }, 5000);
}

 

Also, on the Google side, I have a Service Account setup, but no API keys or OAuth.

I have the very same problem. What is more, the traffic is recorded after I click the getButton as seen in the Google Cloud Platform Dashboard:

But nothing happens on the website. Is it the same in your case @tom.nahas?

Do you think you could help us @yisrael-wix ?


PS. The instruction I followed: https://www.wix.com/velo/reference/velo-package-readmes/google-sheets-integration

I got this one. We should replace:

$w ( ‘#nameOutput’ ). value = name ;
$w ( ‘#emailOutput’ ). value = email ;

with

$w ( ‘#nameOutput’ ).text = name ;
$w ( ‘#emailOutput’ ).text = email ;

Good luck with your project and let me know @tom.nahas if it works also for you!