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:
- Include comments to explain what each part of your script does so others can understand and adjust for their own bases.
- Give any variables or functions descriptive names to make your script easier to read and understand.
- When posting code on the forum, use triple-backticks before and after your code to enable code formatting and coloring:
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.
- When open sourcing a script, also share a copy of the matching base on Airtable Universe so others can see the script in context. Make sure the “Show code in public shares” setting is enabled for your script in this base so people can read and copy it:
That’s it! Have any best practices or tips of your own? Share below