• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

    🚀 Exclusive Lifetime Offers 🚀

    We invite you to take advantage of our special one-time payment plans, providing lifetime access to select applications:

    • 🔥 Pabbly Connect — Lifetime Access for $249View Offer
    • 🔥 Pabbly Subscription Billing — Lifetime Access for $249View Offer
    • 🔥 Pabbly Chatflow — Lifetime Access for $249View Offer

    Make a one-time investment and enjoy the advantages of robust business management tools for years to come.

Random Text and Number and special characters

gulito

Member
Hi

I would like to generate initial passwords for our app. That should contain text and numbers and maybe special characters.
I know that I can use the formater to gennerate random text like that:

Number Formatter -> Spreadsheet Functions
RANDBETWEEN(11111111,99999999)
This will generate a random number between 11111111 & 99999999 every time the action is fired.

However I would like to get a combination also with text and maybe special characters.
Is there a possibility to achieve that in pabbly connect?

Thanks for your help.
best
Olivier
 
P

Pabblymember11

Guest
Hey @gulito

Certainly, you can create an alpha-numeric password in Pabbly Connect with the help of the Code action step of JavaScript.

1684317257053.png


function generateRandomPassword(length) { var charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; var password = ""; // Ensure at least one number in the password var hasNumber = false; for (var i = 0; i < length; i++) { var randomIndex = Math.floor(Math.random() * charset.length); var character = charset.charAt(randomIndex); if (!hasNumber && /[0-9]/.test(character)) { // If no number in password yet, add a number hasNumber = true; } password += character; } // If no number in password, add a random number at a random position if (!hasNumber) { var randomPosition = Math.floor(Math.random() * length); var randomNumber = Math.floor(Math.random() * 10); password = password.slice(0, randomPosition) + randomNumber.toString() + password.slice(randomPosition + 1); } return password; } var password = generateRandomPassword(10); return(password);
 
Top