Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Dec 13, 2018 02:18 PM
Hi, I want to post a job that I’m looking for someone we can create us a solution that we can have a random 4 numeric digits, that we want to have a random unique combination of four digits, the “0” ( or “00”, “000”) can not be in the beginning, in practical, when I create the records on the column, for example “Book” is the first column (primary key in airtable), the records will be “Book 1”, “Book 2”, Book 3"….and I want whenever I create a new records, for instance “Book 4”, there would be generating the random unique combination of four digits automatically on column “ID”, please see the image I’ve attached.
I need some excellent folks to help.
Let’s try to make this happen.
Dec 18, 2018 09:31 AM
No problem:
What we are doing is updating the record that was just created. So we need to give it the ‘Record ID’ from ‘Step 1’. (This is the row ID from the new book that was created).
Zapier calls this a ‘custom value’ because you are passing in a value from another step. I suggest reading the help doc to get a better understanding.
Dec 18, 2018 02:38 PM
HI @bdelanghe , thanks for your patient, you can imagine that I’m not as PRO as you, I think i’m in the last step of the victory. This “customer value” is really hard to understand.
There are many fields that when I click the dropdown menu are a long mix numeric and digits…do I just need to choose anyone of them? Could you please tell me more about this concept? or if you don’t mind could you please screen shot some images that this is so hard to understand for ppl like me who doens’t understahnd the coding.
Dec 20, 2018 08:06 PM
@Xing Sent you a message.
Feb 16, 2019 07:31 AM
Because this was (apparently) taken to private messages, I’m not sure if a solution was ever found to this problem. Whether or not it was, one question I have—which I couldn’t see answered in any of the other comments—is: why does the number have to be random? As long as it matches the other criteria—unique, four digits, and does not begin with 0—does it matter if it’s random vs sequential? If sequential is okay, there’s an easy way to get that. (Just throwing this out there as an alternate solution in case it helps anyone else.)
Make the second field an Autonumber field. Add a third field (ID) that’s a formula:
Autonumber+999
For the first record, its value will be 1000, and each record’s ID will increase from there. Now you can hide the Autonumber field, as you don’t need to see it.
Mar 04, 2019 02:28 AM
hi Justin, thanks for your useful message, I’m sure there are some ppl would want to know the reason why I needed the random number.
Here is my situation I’m working on a project which is the inventory and I want all the stock number randomly.
For instance, I have Product A, and 100 pieces of product A, and Product B which is 50 pieces.
I want all the number randomly which the clients can not guess which piece is from A and which piece is from B.
For example, if I have A, 100-199, if the number is randomly, the clients can not know the “internal fact”.
Mar 04, 2019 06:47 PM
Maybe there’s some deeper reason that’s implied in this explanation, but I can’t picture a scenario where I would care about what the client might or might not guess about how products are set up behind the scenes. If you don’t want the client to know how your products are set up, omit the product numbers from any document the client is going to view. In most stock scenarios, stock/product numbers are for internal use only. Even if the end customer/client sees them, they typically don’t care about the product numbering scheme. They care about the product.
Anyway, I’m not trying to dissuade you from going the random number route. I’m just having a hard time understanding the details of your specific situation. No need to explain further, though. If you were able to reach a solution that gave you what you wanted, that’s all that matters.
Mar 05, 2019 05:29 AM
The most problem common on issue is going to be like this
A product
1001
1002
1003
B product
1004
1005
1006
But after a while if I want to add one piece on A product it will be
A product
1001
1002
1003
1007
B product
1004
1005
1006
This 1007 is weird, doesn’t it? But if all the numbers are randomly, there is no such a odd situation
Mar 05, 2019 05:57 PM
One way to solve that is to use completely different number groupings for A and B products. If A starts with 1001, perhaps B starts with 2001. If the A product line will have more than 1000 items in it, B could start higher, like 3001, or 5001, or whatever works for your situation.
Generating these numbers would be fairly easy as long as you track the A and B products in different tables. Their numbering formulas would be set based on their respective numbering schemes. In the A table, it could be Autonumber+1000
, and for the B table, it would be Autonumber+2000
or whatever you decide.
If you’ve got more than just A and B, spread out the number groupings as you need for your products. If necessary, maybe go to five digits instead of four, or six digits, or whatever makes sense.
Mar 06, 2019 06:36 AM
But we have more than 100 products.
Best regards,
Mar 06, 2019 09:14 AM
In that case, consider a segmented product code, something like 101-001, where the first part is the base product type, and the second part represents the variation of that product. With three digits in each part, you could have a thousand products (or 900 if you don’t want leading zeroes in your product codes), each with a thousand variations. If that’s not enough options, add more digits to accommodate more products/variations. Obviously this would be cumbersome to track with each product in a new table, but with the help of Zapier or Integromat, the numbering scheme might still be something you could semi-automate. Here’s a quick mockup of what that might look like:
The Product Categories table is the master list of products by category, with an autonumber setup like I described above to give each category its own category code. The Products table is where all of the actual products live. When adding a record for a new product, you would choose its category in the Category field, which then auto-fills the Cat. Code field. Zapier/Integromat would then recognize the new record, count how many products currently exist in that category, and fill the Product Code field in that record with the next variation number in the sequence.
The building of the full code in the Product Code field may also be doable with formulas, though I can’t yet wrap my head around how that would work. Most likely it would require another table and some combination of lookups/rollups/etc. However, the issue I see there is that if you ever re-order your records in the Products table, the formula would likewise re-number the product codes with different variation numbers than they had before. By using an integration service, the Product Code field data is filled once by the service, and would stay unchanged if the record order ever shifts.