Is there an easy way to share functions between queries and transformers? More specifically, my application uses MySQL with many columns that are datetime and whenever queries are done it needs to be formatted with moment. The end result is moment.utc(date).format("YYYY-MM-DD HH:mm:ss") is littered all over the queries. It would be much easier if I could move this into a function (ie formatDate(date)).
It looks like this could be done by triggering js queries, but needing to add the addtionalScope parameter is a little messy.
Also, I have noticed that it can take a page reload or two to get the function to be recognized.
Additionally, if there is a syntax error in the function it will not be created and thus not available. This last one has gotten me more times than I care to count. Let Chrome (or equivalent) Dev Tools check that for you - though sometimes it fails to notify of an error when there is one - but stepping through the code reveals this. Ain't programming fun!
Hello all again, providing a quick update here. Earlier this year in March 2025, we launched App Functions Beta, which is the updated version of the Sync Functions Erin mentioned above.
App functions enable you to write reusable logic with dynamic parameters. Use functions when you want to perform the same actions on different pages, with different parameters, and return different data.
We’ve made updates in the app around how to write reusable logic, so check out the latest docs on App Functions! This feature is currently in beta, so let us know if you’d like to be added!