Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Can a function be shared in other scripts?

Topic Labels: Automations
Solved
Jump to Solution
139 1
cancel
Showing results for 
Search instead for 
Did you mean: 
JeffJohnVol
7 - App Architect
7 - App Architect

I've been working with scripts and have been loving it.  I know the answer to this is probably no, and would be nice to have, but not a huge thing but....

Is it possible to have a some common functions that I write shared across other scripts I use in my base?  I can continue to just copy/paste them in the scripts I need.   I know it goes against the ethos of low-code, I just have a few I use a lot.

Jeff Johnson
President, ChattLab Makerspace
1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

No, you cannot easily share code between scripts. Keep copy/pasting. You can format your code so that it is easy to copy/paste a set of common functions in bulk when you want to update it.

Some people have experimented with things like storing code externally in a table or on a third party service, and then using eval(). However, eval() is not supported in automation scripts. Plus, putting code where it could be accidentally messed with by other people is just asking for trouble.

I personally find that over the years, I tend to have fewer and fewer common functions across scripts.

See Solution in Thread

1 Reply 1
kuovonne
18 - Pluto
18 - Pluto

No, you cannot easily share code between scripts. Keep copy/pasting. You can format your code so that it is easy to copy/paste a set of common functions in bulk when you want to update it.

Some people have experimented with things like storing code externally in a table or on a third party service, and then using eval(). However, eval() is not supported in automation scripts. Plus, putting code where it could be accidentally messed with by other people is just asking for trouble.

I personally find that over the years, I tend to have fewer and fewer common functions across scripts.