Random password generator

How to create a simple password generator in Power Automate

This is a simple and easy way to generate a password, as well as other random data such as emails or phone numbers for testing purposes, using Power Automate.

Step 1: Create a Compose with an array of letters

[
  "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",
  "æ",
  "ø",
  "å"
]

Step 2: Create a Compose with an array of special characters

  [
    "!",
    "\"",
    "#",
    "$",
    "%",
    "&",
    "'",
    "(",
    ")",
    "*",
    "+",
    ",",
    "-",
    ".",
    "/",
    ":",
    ";",
    "<",
    "=",
    ">",
    "?",
    "@",
    "[",
    "\\",
    "]",
    "^",
    "_",
    "`",
    "{",
    "|",
    "}",
    "~"
  ]

Step 3: Create another Compose that uses Concat() and Rand() to generate a fix length string based on random letters and special characters

concat(
    outputs('Compose_|_Characters_Array')?[rand(0, 30)],
    outputs('Compose_|_Characters_Array')?[rand(0, 30)], 
    rand(0, 30),
    outputs('Compose_|_Special_Characters_Array')?[rand(0, 30)],
    outputs('Compose_|_Characters_Array')?[rand(0, 30)], 
    rand(0, 30),
    outputs('Compose_|_Characters_Array')?[rand(0, 30)],
    toUpper(outputs('Compose_|_Special_Characters_Array')?[rand(0, 30)]), 
    rand(0, 30),
    outputs('Compose_|_Characters_Array')?[rand(0, 30)],
    outputs('Compose_|_Special_Characters_Array')?[rand(0, 30)], 
    rand(0, 30),
    toUpper(outputs('Compose_|_Characters_Array')?[rand(0, 30)]),
    outputs('Compose_|_Characters_Array')?[rand(0, 30)]
)

Step 4: Run your flow and see the result. This will output something like the image below: