Building this process involves using two separate tools outside of Airtable: an integration service called Zapier and a barcode generating API called www.barcodes4.me. By following these instructions, you’ll be able to take an input field, use Zapier to feed that value into a barcode generation API, then upload the resulting barcode directly into your Airtable base.
To start, you’ll need an input field – I used a barcode field in my example. This will be where you type or scan the value which should be encoded into the barcode. Additionally, create one attachment field (for the Zap output) and one formula field (for the Zap input).
Here is the formula in my formula field:
Here’s how that would look:
This formula builds an API request using the barcode value we input into our barcode field, along with some other parameters.
To change the barcode type of the Zap output, you’ll want to adjust the part of the URL which says ‘c39’ in the formula above, if necessary. For a list of code designators, check this page: http://barcodes4.me/apidocumentation
This wraps up designing our table. Now we just need to make the Zap.
In Zapier, create a 2-step zap with the following steps:
Trigger: New record in Airtable. Point this to the table you’ve just created in the steps above.
Action: Update record in Airtable. As you’re setting up this step, be sure to set the value for ‘Record’ to ‘Use a Custom Value’. This will let us choose a value from the new record detected in Step 1, allowing this Zap to dynamically assign values according to the current record.
Scrolling further down, we’ll want this step to update 1 field in the record – the attachment field we created in our table. Attachment fields can upload an image from a URL, which is what we generated with our URL formula field. By copying this URL from the formula field into the attachment field, our upload the resulting barcode image directly from the API.
This Zap will run every 15 minutes or so on Zapier’s free plan, so it may take a few minutes to generate code once the record has been created.