Context: Our new app runs a couple of Javascript queries that I realized only recently are not included in Retool audit logs. Sometimes our end users have JS queries throwing errors on their end that are difficult to debug, so I am planning on implementing an audit log for Javascript query runs.
Just like in audit logs, I would like to log the query's metadata and the parameters passed. From my understanding, these are only accessible via the Promise returned from trigger()
calls. This should be easy to do for queries triggered inside another Javascript query, but what about for queries that are triggered via a button click event handler?
Is it possible for a query to return a Promise or an object containing its metadata, triggeredById
, and the parameters/additional scope passed to it, at the end of its run?
Any suggestions on implementing this custom audit log also greatly appreciated!