Google Form Submit Capture onSubmit custom Google Apps Script Code Create custom Logger Lesson

Google Form Submit Capture onSubmit custom Google Apps Script Code Create custom Logger Lesson

Creating a Simple Form with Google Apps Script

In this section, we will learn how to create a simple form with just one question asking for a favorite number. We will also create a spreadsheet that's attached to the form so we can capture all of the form responses. Within the app script, we'll cover how to create a separate custom log and send an auto-response email.

Creating a Custom Log

  • We'll be covering how to create a separate custom log using Google Apps Script.
  • We're going to be creating a custom function so that we can capture information directly within the spreadsheet.
  • The logs are being captured within the log sheet using the custom Google apps script.

Sending Auto-Response Email

  • We'll be checking if there is an email address and sending an auto-response email that says thank you.
  • An email will also be sent to the script owner when someone submits the form.

Setting Up Google Forms and Spreadsheets

In this section, we will learn how to set up Google Forms and Spreadsheets for our application.

Creating A New Form

  • Go over to your Google dashboard and select "New Form."
  • You can add multiple fields here, including multiple-choice questions.

Connecting To A Spreadsheet

  • You can connect your form responses to a new or existing spreadsheet.
  • By default, the response information will go to a new spreadsheet.
  • You can customize the form and change settings such as collecting email addresses by default.

Overall, this lesson covers how to create a simple form with Google Apps Script and connect it to a spreadsheet. We also learned how to create a custom log and send an auto-response email. Finally, we covered how to set up Google Forms and Spreadsheets for our application.

Capturing Form Submissions and Running Code within a Google Sheet

In this section, the speaker explains how to capture form submissions and run code within a Google Sheet.

Creating a Form and Attaching it to a Spreadsheet

  • To capture form submissions, create a form by selecting "Manage Form" under "Tools".
  • Once the form is created, attach it to a Google Sheet.
  • Under "Extensions", select "Apps Script Editor" to open up a script.

Setting Up the Trigger Function

  • Rename the default function as "my submit".
  • Add code that will run whenever the form is submitted.
  • Set up the trigger function in the spreadsheet attached to the form.
  • Accept permissions for the trigger to run.

Logging Information from Form Submissions

  • Use logger.log() to track information from each submission.
  • Create custom logging by creating a separate sheet called "log".
  • Use getActiveSpreadsheet() and getSheetByName() functions to select and append data into the log sheet.

Tracking Form Submissions in a Spreadsheet

In this section, the speaker explains how to track form submissions directly within a spreadsheet using object information. They also discuss how to access and log specific data from the form submissions.

Tracking Form Submissions

  • To track form submissions directly within a spreadsheet, make another submission and go into the form to see the next submission.
  • Object information can be used to track information directly within the spreadsheet instead of going into the app script and selecting under executions.
  • Named values are contained within an object, which can be selected by number or name.
  • Updating the form will change the object information that is being tracked in the spreadsheet.
  • Specific data can be accessed by selecting named values and then breaking it apart into separate parts.

Accessing Specific Data

  • If you know what data you want to append, break it apart into object names instead of stringifying it.
  • Specific data such as email address and timestamp can be accessed by selecting them under named values or looping through object information.
  • Submitting different sets of numbers will break apart that information into separate columns within your tracking sheet.

Customizing Form Submissions

  • You can customize your own log for form submissions using my submit function.
  • Changing question data will change column information and object information being selected.
  • An auto-response email or email notification can be sent when a particular form has been submitted.

Sending Email Notifications

  • The active user's email address can be obtained from the session to send an email notification.
  • The send mail method is used to send the email notification.

Overview of the E Object

In this section, the speaker explains how to use the E object and customize it as needed.

Using the E Object

  • The E object contains named values.
  • You can customize the E object as needed.

Sending Emails with Google Scripts

In this section, the speaker explains how to send emails using Google Scripts and how to accept permissions for sending emails.

Accepting Permissions for Sending Emails

  • To send an email using Google Scripts, you need to accept permissions first.
  • Run a function to accept permissions and allow the script to send an email.

Sending Emails with Google Scripts

  • If there is no data within the E object, an error will be thrown when trying to send an email.
  • Add a number within a live form and test if it sends an email successfully.

Collecting Email Addresses in Forms

In this section, the speaker explains how to collect email addresses in forms and use them for sending auto-responses or additional emails.

Collecting Email Addresses in Forms

  • Under form settings, select "collect email address" by default.
  • Selecting an email address gives more information within the form.

Sending Auto-responses or Additional Emails

  • If there is an email address within the script's named values object, we can send an additional email or auto-response.
  • Use conditional statements to check if there is an email address available before sending additional emails.

Customizing Thank You Messages in Forms

In this section, the speaker explains how to customize thank you messages in forms using HTML code.

Customizing Thank You Messages

  • Use HTML code to customize thank you messages in forms.
  • Test the customized message by submitting a form and checking the email inbox for an auto-response.
Video description

Form Submit custom triggers and logs Google Form Auto respond and custom Logger Google Form Submit Capture onSubmit custom Google Apps Script Code Create custom Logger Lesson Course content web development and web design courses with coding examples and source code for the lesson content. Source Code is available within my Github account. Lessons posted are designed to help students learn more about a specific topic related to modern web development and applying code. Laurence Svekis is a professional top selling course author having instructed over 1 Million students both online and in person. Laurence Svekis is a Google Developer Expert specializing in Google Workspace automation using Google Apps Script Code. Check out my Website for more details at https://basescripts.com/ Subscribe - https://www.youtube.com/@LaurenceSvek... Tags and Keywords #AppsScript #googlesheets #workspace #accounting #finance #automation modern web design online course #onlinecourses #modernwebdesign #tips #appsscript #coding #codingtutorial #script #scriptinghelp #google #Viral #subscribe #helping #GoogleAppsScript #Gmail #Attachments #Spreadsheet #Automation #GmailAttachments #GoogleAppsScript #EmailProductivity #Automation #SpreadsheetLogs #AttachmentDetails #TechTips #ProductivityHacks #GoogleDrive #GmailSearch #GoogleAppsScript #Spreadsheet #Email #Automation #Iteration #subscribe #GoogleSheets #GoogleAppsScript #CustomUIMenu #SpreadsheetTips #ProductivityTips #TechTutorial #CodingTutorial #BeginnerFriendly #StepByStepGuide