Is it possible to generate a more robust string of text using field formulas?
Options
Brittany_113261
Posts: 7
in Questions
When generating a random string of text using field formulas, is it possible to make that string a bit more robust? For example, a combination uppercase letters, lowercase letters, numbers and maybe symbols.
0
Best Answer
-
@Brittany_312042 You can use the following formula:
var result = ''; var stringLength = 10; var characters ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-!.@#$%'; for ( var i = 0; i < stringLength; i++ ) { result += characters.charAt(Math.floor(Math.random() * characters.length)); }
Note that you can change the number after
stringLength
to define how long the string should be, and you can change the characters aftercharacters
to determine what letters, numbers and symbols should be part of the random string.5