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!
For those who have stumbled across this thread -- we just launched a closed alpha for Sync Functions. Let me know if you'd like to be added!
Best,
Erin
Update: The closed beta for resource functions and sync functions has concluded, and the feature is not being enabled for additional organizations. No further improvements or bug fixes will be made. See the Legacy: Resource and sync functions docs for details.
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.
Update: The closed beta for resource functions and sync functions has concluded, and the feature is not being enabled for additional organizations. No further improvements or bug fixes will be made. See the Legacy: Resource and sync functions docs for details.