Hello all,
I'm currently working on a project where I need to send data to the app script in order to apply a filter to the google sheet with sent data.
The issue is that the connection is here but the filter didn't apply.
I applied the filter function manually through the app script and it works.
I think its something wrong with the doGet
and doPost
or the tagData
here is the block
here is the code
function doGet(e) {
var ss = SpreadsheetApp.openByUrl("SheetUrl")
var sheet = ss.getSheetByName("testo");
var params = JSON.stringify(tagData(e,sheet));
return HtmlService.createHtmlOutput(params);
}
function doPost(e) {
var ss = SpreadsheetApp.openByUrl("SheetUrl")
var sheet = ss.getSheetByName("testo");
ContentService.createTextOutput(fJSON.stringify(e))
}
function tagData(e,sheet) {
var Location = e.parameter.Location;
sheet.append([Location]);
return { Location: Location }
}
function filterOnText() {
var ss = SpreadsheetApp.getActive();
var range = ss.getDataRange();
var filter = range.getFilter() || range.createFilter()
var text = SpreadsheetApp.newFilterCriteria().whenTextContains(Location);
filter.setColumnFilterCriteria(1, text);
thanks in advance for the help.