A follow up to my last comment. You will notice in the documentation that you need to await the appendvalueswrapper function call. I would try structuring your code similarly to the documentation .
And I’ve also taken your note about needing a more in depth tutorial outside of the integration docs. I think that’s a good idea as well, but it will take some time to create/release that.
import { appendValuesWrapper } from 'backend/googlesheet-wrapper.jsw';
$w.onReady(function () {
registerHandlers();
});
function registerHandlers() {
$w('#appendButton').onClick(() => saveValuesToSheet());
}
async function saveValuesToSheet() {
const name = $w('#nameInput').value;
const email = $w('#emailInput').value;
const values = [name, email];
try {
const res = await appendValuesWrapper(values);
$w('#nameInput').value = '';
$w('#emailInput').value = '';
showMessage(res);
} catch (err) {
showMessage(err.toString());
}
}
function showMessage(msg) {
$w('#showMsg').text = msg;
$w('#showMsg').expand()
setTimeout(() => {
$w('#showMsg').collapse();
}, 5000);
}