I recently worked with a client who required a uniquely formatted identification code for their business. This ID had to match the format of their pre-existing system, which was made up of four random letters, a hyphen, and four random numbers (XXXX-XXXX).
The task was complicated by the specific requirements: the letters needed to be in uppercase and the numbers needed to be between 1000-9999.
This ruled out the usage of a conventional Auto-Number system, as it is static and not sufficiently dynamic for our needs.
Among the functions we used, Concat alone is used to join two or more strings into one string. Sequence returns a table of sequential numbers, Char returns a text string that corresponds to a provided number code, and RandBetween returns a random number between the two numbers provided.
The Power Fx provided a dynamic and efficient solution for generating unique IDs that adhered to the client's specific formatting. With a combination of several functions including Concat - for merging strings, Sequence - for sequential number generation, Char - for generating text corresponding to provided number codes, and RandBetween - for generating random numbers in a given range, this solution successfully catered to the client's complex ID generation needs.
Read the full article Generate a Unique ID with Power Fx
Power Fx can be used to generate a Unique ID with a specific format. The format requires 4 randomised capital letters followed by a hyphen, followed by a 4-digit number between 1000-9999. To generate this type of ID, Power Fx needs to be used in combination with the Concat, Sequence, Char, RandBetween & Te functions. Concatenate is used to combine two or more strings, Sequence generates a sequence of numbers, Char converts a number into a character, RandBetween generates a random number between two numbers and Te is used to convert a string to text. These functions can be used together to generate a Unique ID with the desired format.
Generate Unique ID, Power Fx, Concat, Sequence, Char, RandBetween