New features - Generate random string value

Issue #630 resolved
Former user created an issue

The plug-in lacked the functionality to generate a random string of letters, numbers, special characters. The function should allow you to specify the length of the string and its complexity (big and small letters, numbers, special characters). As an example, a password can be randomly generated and the value set in the field indicated.

Comments (6)

  1. Fidel Castro Armario repo owner

    Hi @dpodgorski,

    You can do it using "Copy a parsed text to a field" post-function with the following configuration:

    Captura de pantalla 2017-05-26 a las 10.12.33.png

    Text expression is:

    toString(textOnNumberList([0, 0, 0, 0, 0, 0, 0, 0, 0, 0], getAscii(modulus(round(random() * 10000), 94) + 33)), "")
    

    The string length is the number of zeroes in the number list. In the example the string generated has 10 characters.

  2. Former user Account Deleted reporter
    • changed status to open

    How to change this configuration so that special characters are limited to @ # !?

  3. Fidel Castro Armario repo owner

    Use the following configuration: Captura de pantalla 2017-05-26 a las 18.08.22.png

    String expression is:

    toString(textOnNumberList([0, 0, 0, 0, 0, 0, 0, 0, 0, 0], nthElement(["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", "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", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "?", "!", "@"], modulus(round(random() * 10000), 65) + 1)), "")
    

    65 is the number of elements in the string list with the legal characters. If you add more characters to the list, you should update that number.

  4. Log in to comment