Skip to content

Instantly share code, notes, and snippets.

View bencha27's full-sized avatar

Ben Cha bencha27

View GitHub Profile
@bencha27
bencha27 / googleFormsOrderForm.md
Last active April 29, 2024 22:02
Create a Dynamic Order Form in Google Forms

Create a Dynamic Order Form in Google Forms

Use Apps Script in Google Forms to dynamically update item quantity dropdowns based on available stock

Introduction

This tutorial explains how to create a dynamic order form in Google Forms.

  • The order form uses dropdowns for customers to choose the quantity of an item that they want to order.
  • The Apps Script code connects the Google Form to the linked Google Sheet with form responses.
  • The total (starting) stock for each item is set in the spreadsheet by the seller.
  • The remaining stock for each item is calculated in the spreadsheet based on submitted orders.
  • The dropdowns in the order form are updated so that the maximum quantity of an item that a customer can order is the remaining stock of that item.
@bencha27
bencha27 / regexEmailValidation.md
Last active April 29, 2024 22:03
Regex Tutorial: Email Validation

Regex Tutorial: Email Validation

How can regular expressions (regex) be used to validate specific text formats?

Introduction

Regular expressions, or regex for short, are sequences of characters that specify a search pattern in text. They are used to find matches to specific patterns of characters, whether literal (e.g., specific words or phrases) or non-literal (e.g., alphanumeric characters, lowercase letters). One common example of regex is in validating email addresses. The following regex can be used to check whether an input is a properly formatted email address: