title: How do I handle form data from a form with multiple fields in node?
body: <p>I'm trying to build a page for people to RSVP for a wedding website. The guest types in their email address, and the page finds all guests that appear on that invitation and then generates a table:</p>
  <pre><code>&lt;%- include(&quot;./partials/header&quot;) %&gt;
  &lt;h2&gt;
      RSVP
  &lt;/h2&gt;
  
  
  
  
  &lt;div class=&quot;container&quot;&gt;
      &lt;div class=&quot; row justify-content-center&quot;&gt;
          &lt;h5&gt;Enter the email address that appears on your invitation.&lt;/h5&gt;
      &lt;/div&gt;
      &lt;div class=&quot; row justify-content-center&quot;&gt;
          &lt;div id=&quot;form-findGuest&quot;&gt;
              &lt;form action=&quot;/rsvp&quot; method=&quot;GET&quot;&gt;
                  &lt;input type=&quot;text&quot; name=&quot;searchEmail&quot; placeholder=&quot;email&quot;&gt;
                  &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      
      &lt;div class=&quot;row justify-content-center&quot;&gt;
          &lt;form action=&quot;/rsvp&quot; method=&quot;POST&quot;&gt;
              &lt;table class=&quot;table&quot;&gt;
                  &lt;% for(i=0;i&lt;guests.length;i++){ %&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;%= guests[i].name %&gt;&lt;/td&gt;  
                          &lt;% if(guests[i].isComing){ %&gt;
                              &lt;td&gt;Attending&lt;/td&gt;
                          &lt;% } else { %&gt;
                              &lt;td&gt;Not Attending&lt;/td&gt;
                          &lt;% } %&gt;
                          &lt;td&gt;
                          &lt;td&gt;
                                  &lt;input type=&quot;checkbox&quot;&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;% }%&gt;
              &lt;/table&gt;
          &lt;/form&gt;
      &lt;/div&gt;
      &lt;div class=&quot;row justify-content-center&quot;&gt;
          &lt;a href=&quot;/index&quot; class=&quot;btn btn-secondary&quot;&gt;Back&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  
  
  &lt;%- include(&quot;./partials/footer&quot;) %&gt;
  </code></pre>
  <p>The problem is that I don't know what to do with the post route. Basically I want to do something like this:</p>
  <pre><code>app.post(&quot;/rsvp&quot;, (req, res)=&gt;{
  //  parse the req.body and for each rsvp that got sent here, add it to some array
  //  now use a for loop to iterate through that array and change the isComing value for each guest
      res.redirect(&quot;index&quot;)
  })
  </code></pre>
  <p>But I can't figure out how to parse the req.body when I don't know how many fields are going to be in the request- some email addresses may correspond to only one guest, but others may correspond to, say, five.</p>