I have two event handelers associated with a button. First one is a verification query that returns true or false depending upon the status of verification. The second query is a navigation query that navigates to the next page if the previous query returned true. In the second query I have set the "only run when" parameter as query1.data. Now whats happening is the first query takes 2-3 seconds to run and return its status and in the meanwhile the second query is getting executed aswell and is not navigating to the next page even when the 1st query returned true because by the time it returned the value the 2nd query already ran. How can I work around this and make the second query to run only when the 1st query returns its status
Hi @vanshgandhi,
You can set your event handler in the first query rather than in the button. Put it as a success event with an only run condition and you can refer to the true/false result via {{ self.data }}.
In alternative, you can write a script as a single event handler with query1.trigger( {onSucess: query2.trigger}) (you can add an if logic to make sure query 2 runs only if result of query1 is true)
1 Like
Hey Miguel, Thanks a lot!
1 Like