Tabbed containers and queries

Good morning,

Can anyone tell me, if you are using a tabbed container, and you have tables in each view of that container, do the queries run for all the tables run at the time of page load? If so, is there a way to set it so only the page you are viewing runs the queries necessary for that page?

Thank you.

Hello @tomm!

I believe you can use a little logic within a JS Query to accomplish this.

Your tabbed container needs an event handler to trigger the JS Query on Change (one of the default handler settings). The JS Query will check to see the current view index/key of the container and then trigger the correct table query. The JS Query can also be set to run once on page load in the Advanced settings. Here is a breakdown of all the top level pieces:

Switch to a new tab and the proper table query/action gets triggered (console.log in my example).

1 Like

Hey @tomm! You had a similar post awhile back where I left this solution option as a comment – does this work for you in your current use case?