Hi Scott, I've put a confirmation message before running the JS and it only triggers the on page load event when loading the page, not when returning from a modal.
I did find a work-around and that is to add a globa) variable (here shouldRefreshTasks) to the query like:
where (t1.fk_project = {{ tbl_projects_main.selectedRow.id }}) or (1 = {{ shouldRefreshTasks.value }})
and in the advanced section of the query add "shouldRefreshTasks.value" as a watched input.
When I press the save button on the modal, I change the value with Math.random() * 1000 so the refresh is triggered because the watched value changed.
Not my original brainwave but I found it related to another question: watched inputs