Reputation: 46
Similar to the limit formula in Google Sheets:
=query(F1:F, "select F where F contains '5' limit 10")
How would I limit the amount of returning rows in Google Apps Script, when I want to limit the results? Here is what I have where it pastes my return rows, and the function works correctly, but I need to limit the results to 20:
ws.getRange(6, 11, rows.length, rows[0].length).setValues(rows);
Any suggestions?
Upvotes: 0
Views: 1231
Reputation: 64032
Limiting Rows
var r=rows.slice(0,20);
ws.getRange(6, 11, r.length, r[0].length).setValues(r);
Upvotes: 1