Mar 06, 2021 10:51 AM
I’m a developer and plan on writing A LOT of different scripts.
Let’s say I create a script that sums the values of a column. I plan on using this script (function) in multiple scripts. Is there a way I can essentially call this script in separate scripts instead of having to copy and paste code all the time?
In other words, can I create global functions? Can I call a script in another script?
The same concept applies to global variables. My script will use the name of one of my columns. But if I change the column name, my script won’t work. I have to manually edit the script and change the column name. Global variables, or at least global to the table (doesn’t have to be the entire base), would enable the script to update automatically.
Mar 06, 2021 11:03 AM
Check out On2Air: Scripts which was built to solve this problem
Mar 06, 2021 11:19 AM
Thank you for the link. I’m already paying a lot of money for Airtable Pro. However, paying at least $30/month extra for this is overkill.
Jul 13, 2021 02:18 PM
You can use automations. For example, one script runs and sets a Dropdown to “Run Script C”, and an automation sees that change, detects “Run Script C” and runs that script. This doesn’t really scale all that well, of course… Would be really cool if we could get and call scripts, like scripts[‘Script Name’].call(some data) — that would be incredible
Jul 29, 2021 03:24 AM
Maybe you can call from your script an airtable webhook connected to another script.
Jul 30, 2021 01:38 PM
Can confirm that this works. Here’s what you need and the order in which I’d recommend building it:
one fetch request in base A to:
one webhook automation in base B to:
one webhook automation in Base A to:
Or, just keep repeating the second pattern and have the data rolling through more bases.