title: Button Action to retrieve data from spreadsheet using google app script
body: <p>How to retrieve a complete row from a spreadsheet based on a  filter on an action such as a click of a button.</p>
  
  <p>I read that GAS is server-side scripting and it is complex to gain access to a spreadsheet.</p>
  
  <p>Is that so. Please guide me.</p>
  
  <p>I have done till this:</p>
  
  <pre><code> $("#form-action")
      .button()
      .click(function() {
  
   var ss = SpreadsheetApp.openById("");
  var sheet = SpreadsheetApp.getActiveSpreadsheet();
  SpreadsheetApp.setActiveSheet(sheet.getSheetByName('Test'));
  SpreadsheetApp.getActiveSheet().getRange("D1").setFormula('Query(A:C,"SELECT A,B,C WHERE B="' + "mydata'" + ',1)'); 
  SpreadsheetApp.getActiveSheet().getRange("E:J").getValues();
  
  });
  </code></pre>