Hey there @Sebastian_Pjede ! Welcome to the Coda Community!
The short answer to your question is no - there is no way to automatically hide and unhide pages. But as usual, there is a workaround, albeit not perfect.
Here’s essentially what you would need to do:
Create pages the are actually auto-populated by cells via canvas based formulas. See here for an example of pages that are created via canvas formulas referencing cells, yet still feel somewhat like pages. When on the page, click on the white “open” button to view the page, not the card itself
Next, you would need the information that is populating the pages to be controlled via a select (hidden somewhere else in the document)
You could then write an automation to change/manage that select which would then in turn change the information on the page, and “hide” the information that was previously on a page.
Its weird, and only really fits use cases where you are not having more complex pages (with buttons, reactions, tables, charts, etc)
But essentially the same principles should apply - if you can control the information on a page with a select you can automate what is shown on a page (which would hide/unhide information)
If you need further help feel free to send link to example doc! Happy to help out - just difficult without further context.