-
Goal: In my multi page app I have 4 queries that are run on multiple different pages. I made these 4 queries global. Ideally I would like to see when triggering the global query from one of these pages it should work as normal. But I've noticed that it only works on the page the app is initialized on. When navigating to another page, the query will no longer be triggered. Even clicking on the run button in the editor does nothing.
-
Steps: Have a global query, run it on one page, navigate to another, try to run again.
-
Details: The exact resource is a BigQuery resource. I wonder if that might be the issue.
Thank you very much for any guidance!
Hi @Jordan_Castro_Sauder,
Thanks for reaching out -- we don't have an "on page load" event handler trigger yet, but I've added your +1 to the feature request internally.
Hi Erin!
So it's not that when the page is loaded I need to run the queries but rather I was saying a global query only works on 1 page and no other. And it only works when I load the multi page app on that specific page (think navigation wise). It is a little hard to explain because even I don't quite undertand it.
But essentially I have a query that is run when a user presses a button. This same flow is used in other pages. The flow only works in the first page that the user opens the multi page app in.
Ah I see, thanks for clarifying! Do you see anything in the Debug console logs suggesting the query ran/failed? Also, to your thought about this being an issue with BigQuery -- do you see the same behavior if you swap out the BigQuery query with just a plain JS query?
It looks like even then the queries aren't running. Event the JS queries. Although my JS transformer is working just fine and so are my variables.
Is the button a global component, or is it scoped to each page? Are you able to share an app export?
It is scoped to each page. Although the query is global. But yes the button is scoped.
Can you verify that each button's event handler is configured properly? Another option to debug is to change the event handler to Run script
, and then from the script you can 1. console.log() so we can confirm that the event handler is firing properly, and 2. manually trigger the global query (and potentially try to catch/log any exceptions thrown)
That is the weird part, I have tried to run manually using the run button in the editor and it still wont run.
No errors are thrown either.
Hm -- do you see anything in your browser console?
Yes I do see this:
JSCode triggering drawerQuery
Are you able to repro this in a simpler app, and if so can you share that export?
Ok that was a really good idea. It seems to work just fine in a different multi page app. Even the big query resource I was using works fine.
Is there a setting I might have enabled or disabled in the other app?
Maybe the disabled property? You can export both apps to Toolscript for an easier/nicer way to compare the apps (vs exporting as JSON).
And that would make it only work on the first page the app is opened on. And not work on any others after that?
I should mention that the query can be run multiple times in the page. But when I move to another page that query can no longer be run even from the editor window where the Run button is:

It's definitely strange that even clicking the Run
button manually would not work. Can you share an app export?
Is there a way to contact me directly, because I don't want to provide the app export in a public forum.
Feel free to DM me the app export!
2 Likes