About UNIQUEID()

hello dear all, some of my UNIQUEID() field shows like 【3.02E+04】but【f10738b3】,and it’s randomly happened. how to fix this problem?

by the way, there are over 10000 column in my date sheet, and the database based on google sheet. thanks!

Solved Solved
2 8 1,379
1 ACCEPTED SOLUTION

Equivalent, but shorter:

(mid(“abcdefghijklmnopqrstuvwxyz”, randbetween(1, 26), 1) & uniqueid())

View solution in original post

8 REPLIES 8

To avoid this situation with gSheet, adding a letter before the UNIQUEID() itself like “A”&UNIQUEID(). This will take care that gSheet can’t recognize it as a number like 12345E02.

Perhaps it would be good if AppSheet could tweak the UNIQUEID() algorithm so that a letter was automatically placed at the beginning, regardless of whether or not the gSheet column is set to plain text.

Aesthetically, I’d like to maintain the random appearance of the UNIQUEID() key in my app. Even the students who copy my app probably won’t notice or care about it, but I somehow still care about the appearance. So, here’s my solution:

concatenate(INDEX({“a”,“b”,“c”,“d”,“e”,“f”,“g”,“h”,“i”,“j”,“k”,“l”,“m”,“n”,“o”,“p”,“q”,“r”,“s”,“t”,“u”,“v”,“w”,“x”,“y”,“z”},randbetween(1,26)),uniqueid())

This randomly picks one of the 26 letters of the alphabet as the first letter. It also slightly enhances the “uniqueness” of the randomly generated uniqueid().

Equivalent, but shorter:

(mid(“abcdefghijklmnopqrstuvwxyz”, randbetween(1, 26), 1) & uniqueid())

thanks your help!

@Aleksi, @Steve, @retreat_Ieyasu, @LeventK

This issue has been resolved:

@retreat_Ieyasu
As a side note to @Aleksi’s explanation; please check that the column in your gSheet is formatted as Plain Text as well. When set as automatic, gSheet will treat IDs such as 12345E02 as exponential numbers

Thanks for raising this question, @retreat_Ieyasu! I had the same problem myself (and it caused a problem in the functioning of my app). I was about to post an inquiry but your inquiry saved me the trouble.

Top Labels in this Space