Scripting Experiments

Explore

This base is a place for me to collect some of the scripting solutions I've come up with while working with Airtable. Currently the base includes just one example:

​

LZ-String compression

On a recent project, I needed to transform a large amount of data into a JSON object for use by external applications. Unfortunately, I quickly ran up against Airtable’s 100,000 character limit on text fields. It occurred to me that if I could find a way to compress the JSON data, I could fit more data into a cell and wouldn't have to worry about the character limit.

​

Enter LZ-String.js (https://pieroxy.net/blog/pages/lz-string/index.html). LZ-String.js is a small javascript compression library which can compress text data very quickly and with a decent compression ratio. As JSON tends to have lots of repetitive text in it, it is the perfect candidate for compression. By using this library to compress my JSON values before storing them, I am able to store nearly 10x the amount of data I could otherwise. This can also work on regular plaintext, but it is not nearly as efficient. In my testing, compressed text averages about 25% to 35% of the original character count.

Explore
Updated October 31, 2020 at 9:27 AM
Copied 33 times

Tim Mackey

I'm a developer and designer +, who enjoys using Airtable to augment my projects.
Explore the base
Default View