Generating a random name in @Formula language

Hi

I have a field on a document. When a new document is created this field must have a random name starting with a “M” and in total 8 characters (letters and numbers).

Something like “M9UI0KWL” for instance.

Can this be done with Formula language? What should the code look like?

Any help will be apreciated.

Regards

Subject: generating a random name in @Formula language

Random? Well, sure, but the formula would need to loop and pick characters from a list. There’s a quicker way, though, if you don’t have any more complicated rules than “8 characters starting with ‘M’”:

“M” + @Right(@ReplaceSubstring(@Unique; “-”; “”); 7)

The first character you get from the @Right… will be derived from the user name (probably the last character of the last name), and the rest will be a base-32 time stamp that will look random. The characters “0”, “O”, “1” and “I” will not appear, since they are visually indistinguishable in some fonts (and difficult to distinguish in most), but other than that there will be no apparent pattern.

Subject: RE: generating a random name in @Formula language

Hi Stan

Thank you very much. The formula looks so extremely simple, and still I don’t understand it.

But it works perfectly!!!

You are really smart.

regards

Subject: RE: generating a random name in @Formula language

was looking for similar solution and your suggestion helped me.

Thanks mate !!