How to trigger a function call on page by global object

Hey @bauergeorg - thanks for reaching out. :slightly_smiling_face:

To @MiguelOrtiz's point, there isn't a formal solution to this particular problem. There is, however, a functional workaround that doesn't require polling and thus doesn't have a significant impact on performance.

The basic idea is to write a dummy query on the page that references the globally scoped object. I typically choose a Query JSON with SQL one because it executes client-side and can still have its Run behavior set to Automatic. In the below example, this setup means any changes to globalVariable will trigger dummyQuery.

At that point, all we have to do is trigger actualQuery on the success of dummyQuery.

It's a bit convoluted but works well! Let me know if you have any questions. :+1:

2 Likes