Execute app script to filter dynamic data in google sheet

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.

You are not calling the tagData or filterOnText functions in your doPost(e), therefore all you will get back is the JSON stringified "e".

I called but the filter of the google activated without the sent data

In your App Inventor app you are using POST. This means that the google apps script will run doPost(e) when it receives parameters.

Your current doPost:

function doPost(e) {
  var ss = SpreadsheetApp.openByUrl("SheetUrl")
  var sheet = ss.getSheetByName("testo");
  ContentService.createTextOutput(fJSON.stringify(e))
}

will only return what you have sent it. It is not activating either the tagData or filterOnText functions.

Without seeing the spreadsheet, it is difficult to advise further.

Also, if you just need a subset of data back to the app, it might be easier to use a query....

Query Any Google Sheet with a Web App