Problem whit ID

This is an excellent Post about Keys. Thank you for all your input.

In the documentation we read about UNIQUEID():
The chance of a duplicate ID being generated is virtually zero: just 1 in over 28 trillion.

Does anyone know how this would be with RANDBETWEEN(100000,999999) ?
I never understood how to calculate probability

Hi @Fabian,

You are very right. This is indeed an excellent post thread with very educating inputs from all senior members.

This just about probability calculation part, if I may add a few points. As per my understanding, the probability of UNIQUEID() is based on the calculation as follows-

It is a UNIQUEID() of 8 alphanumeric digits long. Each digit can have 26 alphabets and 10 (0-9) numeric combinations, that is total of 36 combinations for a single digit. So for 8 digits , it will be 36 to the power of 8 which as per my understanding is 2.8 Trillion ( Calculator gives results as 2.8211099 E+12) @Steve may give more insights into this. I might have missed one possible combination, giving result as 2.8 rather than 28, but I believe the calculation basis is as described.

With only numeric digits as in RANDBETWEEN(), the probability calculation is simpler. Since it is only numeric, 2 digits 0-100 will give just 100 possible combinations, for example. In case of RANDBETWEEN(100000,999999) , the probability will be (999999-100000)=899999 or just 0.89 Million , very much lower from that with UNIQUEID()
However RANDBETWEEN(10000000,99999999) will give much better (99999999-10000000)=89999999 or 89 million.

2 Likes

Thank you very much @Suvrutt_Gurjar
That means, one would need to use RANDBETWEEN(1000000000000,9999999999999) to get 8.99 Trillion possible combinations? That would be a little bit more than with UNIQUEID().

Hi @Fabian,

Technically , yes a larger digit base with RANDBETWEEN() will increase the possible combinations. However, there could be certain internal limit with how many maximum digits can be included in RANDBETWEEN() function.

1 Like

I added the uniqueid() in the initial value section but I keep getting this error
Can anyone help this noob?

I have nothing filled in, in the sheet formula section

2 Likes

Hi Steve, thank you for your answer. I tried the formula to add uuids to the existing data. For some reason it did not compute.

I tried also to copy paste from an uuid generator, but appsheet saw it as a formula?

Now I just manually typed in letters and numbers for the 120 existing rows.

And set the initial value to uniqueid() for new data. .
This finally worked.

Greetings,
Pros

Hi @Pros_De_Zutter
If you are manually inserting unique Ids using a formula you need to copy paste as values to remove the formula when it is done.

3 Likes

Perhaps useful:

2 Likes