Created
February 13, 2023 10:31
-
-
Save phillypb/99a12958aca5cb8fcad14c17a483a35d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getFormData(e) { | |
// get all Form responses | |
var formValues = e.namedValues; | |
// get response to specific question | |
var pizzaTopping = formValues["Favourite Pizza Topping"][0]; | |
console.log("pizzaTopping is: " + pizzaTopping); | |
// use JavaScript 'includes' to match text | |
if (pizzaTopping.includes("Chicken")) { | |
console.log("Likes Spicy Chicken"); | |
} else { | |
console.log("Does not like Spicy Chicken"); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment