title: How to get list of only email Items from Forms?
body: <p>In Google Forms, we can set an <code>Item</code> as <code>required</code> and add validation to accept email input for this item.</p>
  
  <p>Now I need to find a way to get <strong><em>only</em></strong> those email fields</p>
  
  <p>This is my implementation at the moment:</p>
  
  <pre><code>const items = FormApp.getActiveForm().getItems()
    return items
      .filter(item =&gt; !!(item.getType() === FormApp.ItemType.TEXT &amp;&amp; item.asTextItem().isRequired()))
      .map(item =&gt; ({
        id: item.getId(),
        title: item.getTitle(),
      }))
  </code></pre>
  
  <p>As you can see, this can only check if the <code>Item</code> is <code>text field</code> and <code>is required</code>.</p>
  
  <p>How to check if the Item is email address?</p>
  
  <hr>
  
  <p><strong>EDIT</strong>: I use this boilerplate to add support for ES6 and React syntax that you see in the code: </p>
  
  <p><a href="https://github.com/enuchi/React-Google-Apps-Script" rel="nofollow noreferrer">https://github.com/enuchi/React-Google-Apps-Script</a></p>