Skip to main content

Formula or script to number records sequentially to appear in 12 or 13 digits for barcode generation

  • September 20, 2023
  • 1 reply
  • 13 views

Forum|alt.badge.img+4

Hello all!  I'm using airtable for my inventory management system.  I'm using a bar code extension, and it needs a field to generate barcodes from that will be either 12 or 13 digits.  I already have a field that has just started from one and numbered each record / item sequentially.  So I'd like to change it to just add enough leading zeros that it will work with the barcode generator.  I don't even know where to start, and everything I tried to google was way more complex than my current understanding of code / scripting.  Would be easier for me to understand if there were a solution with airtable formulas but whatever works.  Thanks!

1 reply

Forum|alt.badge.img+21
  • Inspiring
  • September 21, 2023

Hello @jooline,

This is how the formula is used to fill in the required digits with 0.

 

REPT("0", 12-LEN({Number} & "")) & {Number}

 

 I recommend reading this article as it is also helpful.
Sequential Numbering of Records ยท Kuovonne's Guide to Airtable (coda.io)