Generate a random 8-character string for each record

Options

In a product I'm building I'm in a spot where I think I'll need a way to allow users to invite other users to share data.

My thought is if John wants to let Sarah access his records, John will add both Sarah's email address and Sarah's 8-digit code in a form to add her. Meaning, Sarah doesn't need to receive an email to accept, but she would just give John the 8-digit code.

Any time a user record is created, I'll want a code generated.

What's a good way of accomplishing creating this 8-digit string when a user is created or even if the user records already exist?

Tagged:

Comments

  • Lachlan
    Lachlan Administrator

    ADMIN

    Options

    Hey there!

    I would suggest using the generate password function which you can access when in the function stack builder. You can configure the required character count and some other options as per the screenshot below.

  • Matt
    Matt Member
    Options

    Awesome, thank you - perfect suggestion!