0

I want to submit a form from my web site over to a Gscript file on my Google Drive and have it take the form values, and generate a PDF file and email it. I have this working already using Google Forms, a Google Sheet, but the goal here is to have the data itself stored in a MySQL relational database where data is not duplicated, and as we fill in our form data will auto-populate if it already exists, or we can choose it from a list on the left to fill in pertinent informaton. This is for a donation receipt system for a nonprofit organization.

The key for us is to separate donor information from donations. We want to be able to store our donor info, with things like birthdays, anniversaries, and other miscellaneous information so we can send out birthday cards, etc but not store that data over and over again because they made several donations.

Is there any way I can move the form itself over to a secured portion of my own server, and submit the data over to my .gs file that already parses the data and puts it into the PDF document, Mailchimp, and backwards into my MySQL database, and sends the appropriate emails. I could cut out so much of that extra work on the Google side, and do all of it except for the PDF and email from my own server, and handle the rest from Google if I can just submit the data as a POST or GET request or to JSON to the .GS script.

I cannot find anything about it anywhere.

  • Apps Script has lots of reserved function names. Two of those reserved function names are `doGet()` and `doPost()` Both of them are triggers, or event handlers that get triggered when a GET or POST request is made to the published Web App URL. Data can be passed to Apps Script with the request. Here is a related Stack Overflow post [Link to Stack Overflow Call GAS from external source](http://stackoverflow.com/questions/30126787/call-a-custom-gas-function-from-external-url) – Alan Wells Jul 04 '16 at 16:51
  • Would really like to mark your response as the answer to this question. I had everything working within 30 seconds of reading it... but I don't have the option of doing anything with it. This is much better now, my form collects the data, sends it to Google... Google converts it into JSON... sends it back to my server database into separate relational tables (can't figure out how to capture that before it goes to Google. Will look tomorrow for a way). Google adds them to Mailchimp, generates a PDF receipt, an HTML email, and sends the email with the PDF attached. Well over halfway done. TY! – Tony Blackmon Jul 05 '16 at 10:11

1 Answers1

0

Apps Script has lots of reserved function names. Two of those reserved function names are:

doGet()

and

doPost()

Both of them are triggers, or event handlers that get triggered when a GET or POST request is made to the published Web App URL. Data can be passed to Apps Script with the request. Here is a related Stack Overflow post Link to Stack Overflow Call GAS from external source

Stack Overflow Question

Community
  • 1
  • 1
Alan Wells
  • 30,746
  • 15
  • 104
  • 152