Help

Random number functions

Solved
Jump to Solution
38985 39
cancel
Showing results for 
Search instead for 
Did you mean: 
Daniel_Robbins
6 - Interface Innovator
6 - Interface Innovator

Perhaps I’m missing it, but how do I generate random numbers? I am missing “randbetween” and “rnd” from Excel.
Thanks for any and all help.

39 Replies 39
Avi_Doe
6 - Interface Innovator
6 - Interface Innovator

Sorry but it is not working. With this formula I get the same numbers for several rows…

Not very likely. Did you try to refresh the base?

Avi_Doe
6 - Interface Innovator
6 - Interface Innovator

Yes didn´t help. Random Numbers.PNG

May be I am doing something wrong?

Sorry. You are right. :slightly_smiling_face:

What it does is grab numbers from the RECORD_ID. So the numbers you see are random, but not unique.

The other trick (with time) maybe works better in your case.

A combination of the two methods is an option too of course…

Avi_Doe
6 - Interface Innovator
6 - Interface Innovator

With Record ID you get an unique output. But the outcome looks crazy (many numbers and letters) and so it is not realy usable for an ordernumber.

For order numbers you can also use AT’s Auto Number field. Maybe with something in front of it…

Avi_Doe
6 - Interface Innovator
6 - Interface Innovator

I want to hide the casenumbers to prevent vendors from gathering information out of it. So unfortunately this solution is not working for me.

In software like excel…you have the function RANDOM() for it.

Try DATETIME_FORMAT(CREATED_TIME(),'X').

That will give you the Unix timestamp as a string; e.g., ‘1511398652’. You can then chop it up or otherwise obfuscate it as necessary. The results won’t be random, but they should be unique — with one exception: The first three records in a table are created at the time the table is, and all bear the same timestamp.

In theory, you can use 'x' instead of 'X' as the format specifier and get the timestamp with milliseconds included — ‘1360013296123’ is the example from the Airtable help page — but it appears CREATED_TIME() is stored precise to the second only. The results I get with DATETIME_FORMAT(CREATED_TIME(),'x') all have three zeroes as the rightmost three digits.

Avi_Doe
6 - Interface Innovator
6 - Interface Innovator

Thanks Vann Hall I will use that!