Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Create Unique User by adding number

Featured Replies

I'm trying to create a unique user field that is a combination of a user's first name, their last initial, and a number. To guarantee that every user's name is unique I need to make sure that each new user with the same first name/last initial as an existing one gets a new number appended to the end. For example, in the case of a new user with the first name Joe and last name Smith, the initial combination of first name / last initial would yield JoeS. Since he's the first JoeS in the system, the number field would add the number 1 to the end, resulting in JoeS1 as a unique username. When the next Joe Smith (or Joe Stevenson, or Joe S-anything) enters, the number field would add the number 2 to the end, creating a user JoeS2, and so on.

I have everything working except for the number at the end, and am not sure if I need to have a script to compare existing firstname&lastinitial fields to determine whether or not the combination is unique, then, if not, sort by number to determine the next number in sequence to add (creating JoeS3, and 4, and 47, etc.)

OR if there's a smarter, quicker way to achieve the same result (perhaps a calculation field I haven't sorted out yet)

Anyway it happens, I do want to make sure that the resulting field is in the format firstname lastinitial number. I might have taken the wrong direction to get there, and if so, please let me know.

Any help is much appreciated.

If you actually have a field 'JoeS' then you could find by it as part of the script of adding the new user. If none are found then place a 1 after the JoeS part. If 9 are found then put a 10 after the 'JoeS' part.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.