We’re excited to see so many of you testing out the scripting block! We’re hoping lots of you will be open to sharing the scripts you write with the rest of the community, too. In that spirit, the platform team wanted to share a few best practices for open sourcing a script:
input.recordAsyncto avoid references to specific fields or tables that might be different for other users. If you do reference specific fields or tables directly in your script, we recommend pulling them out into variables and moving them to the top of the script so others can change them to match their own bases.
That’s it! Have any best practices or tips of your own? Share below :arrow_down:
My [additional] nominations…
Let possible users know the target audience for the script
If you code is particularly complicated and might undergo revisions, consider putting it in a public GitHub repository. Include the link to the repository.
Explicitly state the licensing for the code in the comments near the top of the script. There are a variety of possible open source licenses. Some companies have very strict rules about what software licenses they allow their employees to use and prohibit the use of unlicensed code.
If your code will change data in any way
Consider having an undo as the last step of the script. Once the script completes, the ability to undo changes can be very difficult, if not impossible. While a true undo is not possible, you can
Follow generic best practices for coding.