title: google.script.run.withSuccessHandler() returns Undefined
body: <p>I created an array in a separate GS file using the code provided below. I tried calling it in my HTML file. My goal is to compare the contents the array to the parameter <code>email</code>. However, the value returned by <code>google.script.run.withSuccessHandler()</code> is <code>undefined</code></p>
  <pre class="lang-js prettyprint-override"><code>//in GS
  function mailGetter()
  {
    //open sheet
    var sheet = SpreadsheetApp.openByUrl(&quot;https://sheet.url&quot;).getSheetByName(&quot;Email Sheet&quot;).activate();
    //get size of given row range
    var row_data_email = sheet.getRange(&quot;C2:C&quot;).getValues();
    var emailArray = row_data_email.join().split(',').filter(Boolean);
    Logger.log(emailArray);
    
    return emailArray;
  }
  </code></pre>
  <pre><code>//in HTML
  function checkEmail(email) 
      {
        var reg1 = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/;
        var arraySize = google.script.run.withSuccessHandler(misc).sizeGetter(); 
        console.log(arraySize);
        var emailArray = new Array(arraySize);
        emailArray = google.script.run.withSuccessHandler(misc).mailGetter();
        console.log(emailArray);
        
        if (reg1.test(email) == false) 
        {
          emails.style.border = &quot;1px solid red&quot;;
          document.getElementById('submitBtn').disabled = true;
        } 
        else if (reg1.test(email) == true) 
        {
          emails.style.border = &quot;1px solid green&quot;;
          document.getElementById('submitBtn').disabled = false;
        }
        
        for (var row = 0; row &lt; arraySize; row++)
        {
          if (emailArray[row][0] == email)
          {
            emails.style.border = &quot;1px solid green&quot;;
            document.getElementById('submitBtn').disabled = false;
            break;
          }
          else if (emailArray[row][0] != email)
          {
            emails.style.border = &quot;1px solid red&quot;;
            document.getElementById('submitBtn').disabled = true;
          }
        }
      }
  
      function misc()
      {
        console.log(&quot;Pass&quot;);
      }
  </code></pre>