title: Running a nodeJS function from the front end index.html to send input data
body: <p>I'm looking for suggestions on my code that'll help with my understanding of rendering html and calling back functions that are within the hosted index.js file. I'm currently calling a function within the node server but i'd like to pass user inputted variables from a front end form that'll call the function the same way. </p>
  
  <p>I can already reference a google sheets page and call the addRow("row#", "{key:index}") function which adds the inputted variables to the excel page. How can I call this same command while outside the scope of the actual document?  </p>
  
  <pre><code>doc.useServiceAccountAuth(creds, function(err) {
  
      //get all te rows and shit
      doc.getRows(1, function (err, rows) {
          console.log(rows.length);
      })
  //this is a test call of the function which works- I now want to pass it in variables from a user inputted form. 
      submitInfo(doc, 'tabletop fun', 'to have fun', '30', 'will do homework', 'TRUE', '50', 'FALSE')
  
      //call this when a form is submitted
      function submitInfo(doc, activity, description, time, task_for_completion, experience, amount, completed) {
          doc.getRows(1, function(err, rows) {
  
              nextRow = rows.length+1;
  
              doc.addRow(1, { activityID: nextRow, activity: activity, description: description, time: time, task_for_completion: task_for_completion, experience:experience, amount:amount, completed:completed}, function(err) {
                  if(err) {
                      console.log(err);
  
                  }
              })
          })
      }
  })
  </code></pre>
  
  <p><a href="http://prntscr.com/o4nhwv" rel="nofollow noreferrer">http://prntscr.com/o4nhwv</a></p>