Need an automatically generated password sent to new users

I am looking for the best way to automatically create a random password that is sent to a new user added to our user table. Thanks in advance!

Hi @Gene

This can be a challenge :thinking:

There is always a degree of risk when sending a password via email. While I no longer tend to use the methods outlined below, which I recorded a couple of years ago, you may find them useful for inspiration or guidance.

These days, I prefer adapting the self service password reset process introduced to me by another Knack developer. I’ve been meaning to create a video on this method and will aim to get it sorted soon. I’ll be sure to circle back when it’s ready.

In the meantime, if the methods below don’t help you move forward, I’d be happy to connect and share the alternative approach with you.

Automating User Accounts - Part 1 - Knack Database

Automating User Accounts - Part 2 - Knack Database

2 Likes

Hi Gene,

Following on from Carl’s advice, I use a text formula to create an ‘almost’ random password. This takes the initials of the person, then adds 4 number from the middle of the ‘created’ timestamp, when converted to Unix. So the output is the initials followed by 4 seemingly random digits.

left(getNameFirst({Name}),1)left(getNameLast({Name}),1)mid(formatDate({Created},x),5,4)

N.b. you if your field names aren’t ‘Name’ and ‘Created’ you’ll need to slightly alter this.

Hugo

1 Like

Thank you so much!

Thank you, Hugo!

I will watch out for this video. Thanks in advance!