Product id, name id, row id formula functions

I am new to Baserow. I’ve always had help with making spreadsheets so I don’t even know how to use excel properly but I am trying to build a table here myself in Baserow. I’m trying to create a product directory table. I want the row ID function for the entire column to follow a specific sequential order.

So for example I want the very first row from the first column to start as KEV0001. The second row then should be KEV0002 and so on. However, when I delete a row, I don’t want it to skip that particular number (0003) and move on to 0004. So far I only found this function online and it doesn’t work for me, it’s not what I am looking for.

concat(“RD”, row_id())

I quote from the webpage: How to generate unique product IDs in Baserow

Note: the row ID is not intended to count the number of rows in a table. When a row is deleted, the rows that remain are not renumbered. The assigned number is permanently attached to a row and cannot be changed or deleted once assigned to a row in the table, even after the row is deleted.

I don’t want this at all, I want it to follow a numerical and sequential pattern. And when I delete a row I don’t wish it to prevent me from using the row ID number that I deleted.

Another concern I don’t even know if this is possible. Suppose I like to have different prefixes for different types of products, let’s say I am selling furniture. Suppose I have 10 different kind of products.

I’d like to create a function in the first product ID column that addresses what I am asking here.

If the product is a SOFA it gets the prefix SOF in front of a suffix number that follows a sequential pattern starting at 0001. So SOF0001 in the first row. If the 2nd product in the 2nd row is a table, it should automatically get a prefix called TAB in front of its suffix sequential number starting at 0001 in row 2, so its ID would be TAB0001. If row 3 is another sofa product, then it should automatically assign the product code “SOF0002”, and again this is row 3. If I delete any rows ,it should not prevent me from not being able to use a specific product code. I hope this makes sense. How to go about creating a function for this?

Just out of curiosity, if I invite a collaborator who is very knowledgeable in excel functions and data entry but have 0 experience using Baserow. Would all these Baserow functions come intuitively to this collaborator or he/she may often need help from here too?

Thank you very much, Baserow team!

Hey @kev_z,

Currently, deleting a row disrupts the sequence unless you restart it — you have to delete and recreate the column to fix this, but we could simplify the process. How would you expect it to work? Should the system always maintain a 1, 2, 3, … order, regardless of whether rows are deleted or restored?

Regarding the formula for the second point, here’s an example of the formula you need:

concat(left(totext(field('Product')), 3), concat('000', field('Autonumber')))

They are similar, but not the same. Excel has several functions that Baserow doesn’t support. Additionally, Excel’s ability to reference any cell or range of cells isn’t available in Baserow. Baserow calculates values for each cell in the field based on a provided formula. Hope that helps! :slightly_smiling_face:

Thank you :heart_eyes: but what if I want something like this, is this possible?

SOF0001
TAB0001
CHA0001
TAB0002
SOF0002
CHA0002
TAB0003
TAB0004
TAB0005
SOF0003
SOF0004
CHA0003

Instead of having the suffix numbers to follow the increasing pattern 1, 2, 3 regardless of the first 3-letter code, is it possible to get the suffix sequence number to follow the same increasing pattern for each 3 letter code? So I can use every number from 0001 to 9999 for each 3 letter code?

And what if I need to use more numbers than 9999, will it be a problem using the formula?

I just encountered another problem using the formula you gave me. I have only 1 prefix code in the column I want it to go from 0001 to 9999 but when it gets to 10, 11, 12 it becomes 00010, 00011 when it should be 0010, 0011. Is there a way to fix this?

Hey, this formula should fix it:

if(field('Autonumber') < 10, concat(left(totext(field('Product')), 3), concat('000', field('Autonumber'))), if(field('Autonumber') < 100, concat(left(totext(field('Product')), 3), concat('00', field('Autonumber'))), concat(left(totext(field('Product')), 3), concat('0', field('Autonumber')))))

Thank you vey much but I encountered another problem recently… I made a comment in someone’s question. Another member seems to be experiencing the same problem.

adding new rows screw up auto number and row id.

I have this issue… When I delete a row…it delete my row number permanently in the autonumber field but I want the auto number field numbers to match the row number. Is there a way to fix this?

Responded here: Adding new rows screws up Autonumber and Row ID# - #33 by olgatrykush

Another potential option would be:

concat(left(totext(field('Product')), 3), right(concat('000', field('Autonumber')), 4))

Just saving the additional if else statements

1 Like