title: How do I censor an answer to a question through Google forms?
body: <p>I'm using a webhook with discord to display the results in a discord channel. My form has a login using matching expressions. This login includes an email. I want this email censored or removed from what is outputted into the discord channel since I don't want people to see what their email is. I know very little about Google Apps Script so I really need help with this. If you know any Javascript I do hope you can help as Google Apps Script is highly based on javascript.</p>
  
  <p>I've tried using an if statement to recognize what the question says and if it says "Email address:" then it changes the answer to blank. This did not work.</p>
  
  <pre><code>function onSubmit(e) {
  
      var POST_URL = "WEBHOOK";
      var form = FormApp.getActiveForm();
      var allResponses = form.getResponses();
      var latestResponse = allResponses[allResponses.length - 1];
      var response = latestResponse.getItemResponses();
      var items = [];
  
      for (var i = 0; i &lt; response.length; i++) {
          var question = response[i].getItem().getTitle();
          var answer = response[i].getResponse();
          try {
              var parts = answer.match(/[\s\S]{1,1024}/g) || [];
          } catch (e) {
              var parts = answer;
          }
  
          if (answer == "") {
              continue;
          }
  
          for (var j = 0; j &lt; parts.length; j++) {
              if (j == 0) {
                if (question == "Email address:"){
                answer = " ";
                }
                  items.push({
                      "name": question,
                      "value": parts[j],
                      "inline": false
                  });
              } else {
                  items.push({
                      "name": question.concat(" (cont.)"),
                      "value": parts[j],
                      "inline": false
                  });
              }
          }
      }
  
  
      var params = {
          "method": "post",
          "payload": JSON.stringify({
              "embeds": [{
                  "title": "Form",
                  "fields": items,
                  "footer": {
                      "text": "Form"
                  }
              }]
          })
      };
  
    UrlFetchApp.fetch(POST_URL, params);}
  </code></pre>
  
  <p>There are no error messages. I've run the script multiple times and doesn't seem to work. The email is still displayed in the discord channel.</p>