Is there a possibility to check if a query was triggered by a certain query?

I have multiple queries in my application and some of the queries trigger the same query on succes. I was wondering if there is a possibility to check if the query was triggered by a specific query to check if it has to run or not.

Example of my use-case:

  • Query1 triggers Query3 on page load
  • Query2 triggers Query3 on button click
  • Query3 triggers Query4 on succes
  • Query4 only needs to be triggered when Query2 was triggered by Query1

Thanks for the help!

1 Like

Yes there is!
triggeredById is used specifically for that.
here's how to use it:

and here's the full docs on how to use it: https://docs.retool.com/docs/scripting-retool#retrieve-triggering-component-indexes

2 Likes