UNIQUEID()

Hello,

Is it possible that the uniqueid() formula only generates letters?

Thank you

Solved Solved
0 6 176
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

@WillowMobileSys wrote:

Assuming English alphabet, the idea to generate a single random letter is to use an expression like this:

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))

Or:

MID("abcdefghijklmnopqrstuvwxyz", RANDBETWEEN(1, 26), 1)

 

View solution in original post

6 REPLIES 6

No, sorry.  It returns hexadecimal results with no option for only letters.   UNIQUEID()

You could create your own random generator with the RANDBETWEEN() and  INDEX() functions.  

 

Do you have idea with this?

Assuming English alphabet, the idea to generate a single random letter is to use an expression like this:

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))

If you wanted to create, say, an 8 character randomly generated character string then you could use this expression:

CONCATENATE(
LOWER(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))),
LOWER(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))),
LOWER(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))),
LOWER(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))),
LOWER(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))),
LOWER(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))),
LOWER(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))),
)

This obviously is limited by the expression you create.

However, if you wanted to specify the creation of a random character string of any length, you could build a looping construct using actions to do it.

Refer to this article for more on how to create the looping ability:

Looping with Actions

Thank you @WillowMobileSys 

Steve
Platinum 4
Platinum 4

@WillowMobileSys wrote:

Assuming English alphabet, the idea to generate a single random letter is to use an expression like this:

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))

Or:

MID("abcdefghijklmnopqrstuvwxyz", RANDBETWEEN(1, 26), 1)

 

Perfect! Thank you sir @Steve 

Top Labels in this Space