Followed the Googlesheet NPM instructions for a custom input form and worked perfectly from dozens of internal testing.
However when had other people (new to the website) use the form, some 20% who submitted the form, the data did not feed through to Googlesheets. It didn’t matter which browser they used, most were using Chrome.
Noticed the backend code had this small error? Not sure if it’s meant to have the red dot? It’s works fine with this from the beginning so I ignore it.
I’m guessing the problem of not receiving the Data has something to do with when the user clicks the Submit button.
See below for what the ‘on click’ submit code looks like on my form:
import wixLocation from 'wix-location';
export function submitbutton1_click(event) {
saveFormData([$w("#dateText").text, (about 100 input fields here omitted) $w("#marketing").value])
wixLocation.to("/thank-you-page");
}
Do you guys think it’s the wixLocation causing the problem? Taking the user to a new page before the code has a chance to complete the data transfer?
I’m lost at what to do, we can’t have 20% of clients thinking their form has been submitted when in fact we haven’t received any of the information and not even knowing it’s been done.
If there’s any CORVID masters who are very familiar with this type of code, please help or contact me. I’m happy to pay for your review.