title: Google App Script: Listing Cell Items Based Upon Conditional Loop
body: <p>I would like my code to loop through all values listed in Column L. If the value is greater than 0, then I would like the Column K and Column A from that same row to be added to a list. This is what I have got, It's not listing my items, but it is sending the alert with the initial message.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function sendEmail() {
    // getting data from spreadsheet
    var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Plan");
    var startRow = 2; // First row of data to process
    var numRows = 70; // Number of rows to process
  
    var dataRange = sheet.getRange(startRow, 12, numRows, 1);
    var data = dataRange.getValues();
    
    //email Information
    var subject = 'Current Items Needed';
    var message = 'Items needed:' + '\n';
    
    
    var ui = SpreadsheetApp.getUi(); // Same variations.
  
  
    //looping through all of the rows
    for (var i = 0; i &lt; data.length; ++i) {
      var row = data[i];
        
       
      //expiration date information
      var quantity = row[12];  //Look at column L
      var listItem = row[11] + ' of ' + row[1] + '\n'; // 'Col K' of 'Col A'
  
      //checking for today
      if ( quantity &gt; 0 ) {
        message += listItem;
          
      }
    }
  
    ui.alert(message);
  }
      </code></pre>
  </div>
  </div>
  </p>