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

Notifications

Announcements

Community site session details

Community site session details

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

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
    3,844 Super User 2025 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,656 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard