Hi! Thanks for this really useful script... I've used it twice, once perfectly. The other form has a small issue.
The first field it displays in the resulting email body is "Undefined undefined". The rest of the email is fine and accurately displays the data entered. I would guess it has something to do with how the Google Sheets doc is structured? Any ideas would be appreciated.
Do you have an example of the form you could share? There's an example in the repo of one hosted on codepen. It could be a bug or something with looking up with the field isn't working, maybe the form elements have a mismatched name or element or something resulting in a lookup failing (which results in "undefined"?).
Sorry for my slow response - I forgot all about this! Here's the live version of the form. If you need a version on codepen, let me know.
Thanks!
I checked the form on that website. I started prepping the data to submit the form on the client, and this is the payload that was being generated: {"name":"test name","email":"[email protected]","message":"test","formDataNameOrder":"[\"name\",\"email\",\"message\"]","formGoogleSheetName":"responses","formGoogleSendEmail":"[email protected]"}
I don't see anything undefined there & nothing looks obviously wrong with the form to match what you are describing. Idk what your code on the server looks like, but maybe it is doing something funny?
Other oddities I noticed with the form that are unrelated:
Thanks for the thoughts! I will do some poking around and will report back if I figure it out, in case it helps anyone else.
If you have anything else to add for others in the future, we welcome it! Hopefully, you were able to figure it out. :)
Most helpful comment
Thanks for the thoughts! I will do some poking around and will report back if I figure it out, in case it helps anyone else.