title: How can I create a table from answers in a Google Form, in Google Sheets?
body: <p>So I'm really new to JavaScript, and I've been trying to organise, in a automated way, the answers that I get from a Google Form in a Google Sheet.</p>
  <p>I need to organise it in a table, with categories as lines and dates as rows, and with every new answer I need that table to updates itself. The date could only update once a day, and if a person answers in that day, the answer would fall on the row of that day, and on the line of the category that the person chose, and in the cell that cross's both of them an 'X'.</p>
  <p>I know how to work the update part with triggers in Google's AppScript, but I don't know how to design the table.</p>
  <p>If somebody could help me, even if with the most basic table design, I would really appreciate it.</p>
  <p>Here's my sample spreadsheet:</p>
  <p><a href="https://docs.google.com/spreadsheets/d/1zgqldnuXHWGe6LImgfg3nJGyUfNZAd6P1Q1RP-GlYXY/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1zgqldnuXHWGe6LImgfg3nJGyUfNZAd6P1Q1RP-GlYXY/edit?usp=sharing</a></p>
  <p>Thank you</p>
  <p>What I've done to organise a little the answears I got:</p>
  <pre><code>function check_data() {
  
    var num_rows = SpreadsheetApp.getActiveSpreadsheet()
      .getSheetByName(&quot;Respostas do Formulário 1&quot;)
      .getLastRow();
  
    for (i = 2; i &lt; num_rows + 1; i++) {
  
      var colA = SpreadsheetApp.getActiveSpreadsheet()
        .getSheetByName(&quot;Respostas do Formulário 1&quot;)
        .getRange(&quot;A&quot; + i)
        .getValue()
      var colB = SpreadsheetApp.getActiveSpreadsheet()
        .getSheetByName(&quot;Respostas do Formulário 1&quot;)
        .getRange(&quot;B&quot; + i)
        .getValue()
      var colC = SpreadsheetApp.getActiveSpreadsheet()
        .getSheetByName(&quot;Respostas do Formulário 1&quot;)
        .getRange(&quot;C&quot; + i)
        .getValue()
      var colD = SpreadsheetApp.getActiveSpreadsheet()
        .getSheetByName(&quot;Respostas do Formulário 1&quot;)
        .getRange(&quot;D&quot; + i)
        .getValue()
      var colE = SpreadsheetApp.getActiveSpreadsheet()
        .getSheetByName(&quot;Respostas do Formulário 1&quot;)
        .getRange(&quot;E&quot; + i)
        .getValue()
  
      SpreadsheetApp.getActiveSpreadsheet()
        .getSheetByName(&quot;script&quot;)
        .getRange(&quot;A&quot; + i)
        .setValue(colA)
  
      SpreadsheetApp.getActiveSpreadsheet()
        .getSheetByName(&quot;script&quot;)
        .getRange(&quot;B&quot; + i)
        .setValue(colB)
  
      SpreadsheetApp.getActiveSpreadsheet()
        .getSheetByName(&quot;script&quot;)
        .getRange(&quot;C&quot; + i)
        .setValue(colC)
  
      if (colD == 0) {
        SpreadsheetApp.getActiveSpreadsheet()
          .getSheetByName(&quot;script&quot;)
          .getRange(&quot;D&quot; + i)
          .setValue(colE)
      } else {
        SpreadsheetApp.getActiveSpreadsheet()
          .getSheetByName(&quot;script&quot;)
          .getRange(&quot;D&quot; + i)
          .setValue(colD)
      }
  
    }
  }
  </code></pre>