Need to reset table to page 1 with code

You may use a workaround.

Let’s assume you are on page 3 and then you apply a filter that will produce less rows then the rowsPerPage. In that case, you could clear the page counter by changing the type of the table to virtual.

if (data.items.length < 10) {
  $w("#myTable").pagination = {"type": "virtual", "rowsPerPage": 10};
} else
  // return back the pagination
  $w("#myTable").pagination = {"type": "pagination", "rowsPerPage": 10};

If you play with this, you could get the desired behaviour.

PS In Wix Editor, the page is resetting on Page 1, but in live it is not. (a bug it is).