web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to generate random...
Power Automate
Answered

How to generate random password in power automate desktop

(0) ShareShare
ReportReport
Posted on by 24

Hello Everyone,[

Hope all are doing well.

 

I have a problem regarding to generate random password in power automate desktop. I write a VB Script  that generate random password of length 6 including small and capital letter and also number and special character. But it throw syntax error, i am unable to find the exact error.

Anyone please help to resolve this problem.

Here i use Vb Script for generate random password, if anyone  know more simple and easy method then please suggest me.

Here is my VB Script :

Sub Main
    Dim password, charset, i
    Dim randomChar

    ' Define the character set including small letters, capital letters, numbers, and special characters
    charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-=_+[]{}|;:',.<>?/~"

    ' Initialize the password variable
    password = ""

    ' Set the random seed based on the system time
    Randomize

    ' Generate each character of the password randomly from the character set
    For i = 1 To 6 ' Change 6 to the desired length of the password
        randomChar = Mid(charset, Int((Len(charset) * Rnd) + 1), 1)
        password = password & randomChar
    Next

    ' Output the generated password
    SetText password
End Sub

 

Thank you in advance,

Best Regards

Suraj

I have the same question (0)
  • Verified answer
    Riyaz_riz11 Profile Picture
    4,214 Super User 2026 Season 2 on at

    Hi @Suraj_Adhikari ,

    Instead of vb script you can directly use create random text action.

    Ahammad_Riyaz_0-1710476314848.png

     

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    Regards,
    Riyaz

     

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @Suraj_Adhikari ,

     

    You have defined action for generating password in PAD.

    Please use the below action "CREATE RANDOM TEXT" and set required length and characters type.

     

    Thanks,
    Vishnu Reddy

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 308 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 171 Super User 2026 Season 2

#3
Haque Profile Picture

Haque 137 Super User 2026 Season 2

Last 30 days Overall leaderboard