title: How to get the first row number after the last protected range of a Google Sheet using App Scripts
body: <p>I am trying to get the first row number after the last protected range of a Google Sheet using App Scripts. Please note that I have several protected ranges in my Google Sheets. My code is as follows but not working?</p>
  <pre><code>var protections = sheetm.getProtections(SpreadsheetApp.ProtectionType.RANGE);
  var len = protections.length; //last protection
  var lastRow = protections[len].getRange().getLastRow();
  var desiredRow = lowRow + 1;
  </code></pre>