Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

How do I make filters auto-refresh when cells are updated via the API?

$
0
0

I have the following function running in Apps Script, however the onEdit function is only called via manual edits. It does not work when I edit the sheet using the API. Here is the function:

 /** * Automatically sorts the 8th column (not the header row) Ascending. */function onEdit(event){  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();   var editedCell = sheet.getActiveCell();  var columnToSortBy = 8;  var startRow = 2;  var startColumn = 1;  var range = sheet.getRange(startRow,startColumn,sheet.getLastRow()-startRow+1,sheet.getLastColumn()-startColumn+1);  range.sort( { column : columnToSortBy, ascending: true } );}

Edit: A commenter suggested that this question may be similar to another question, see comment below. However that question is discussing the difference between two functions, neither of which solve my issue, this question is asking about a functionality that neither of those functions provide.


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>