Thanks. I think I’ve read that thread before posting here, but unless I’m wrong it addresses a different issue. What I needed to do was not to trigger a view refresh (as I unfortunately suggest in this thread’s title), but rather tell dataview to render a new view from scratch instead of appending to it. This is not the same thing.
Because I’m generating multiple dataview tables in a loop with JavaScript, there was a need to start with an empty page whenever the dropdown value changes, and from what I understand there is no way to do that directly in Obsidian, except by manually removing the existing elements as @mr_abomination suggested.
Anyway, the current solution works wonders for me. In fact, I thought of turning it into a more generic plugin, but I got to get some work done…