Jump to content

Username Creations


This topic is 7392 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I've been given the job to create 30,000+ usernames for our School System

(teachers and Students). I've downloaded their id numbers, surnames and firstnames. We want to create a unique username, using the surname(first 6 chars) and firstname(first 3 chars). However, I have many duplications. Is there a script available that can assign a number to the duplications (eg)smithjoh1,smithjoh2,smithjoh3...etc)Thanks.....

Link to comment
Share on other sites

create a text field with the option AutoEnter, serial value checked.

then create a calculation field that adds the first six characters of surname, the first three of the first name, and the autoenter serial value.

or, if for some reason the length is an issue, add some steps to the calculation to check if the username is unique first, and if it is, it adds nothing. If it isn't unique, it adds one to a counter field in a separate file then adds the new number to the end of the username. then you would only increase the number to add to the username with duplicates, whereas the first example just increases with every student whether they are duplicates or not.

you could shorter it even further and have it always add a one to a duplicate username, and if that still isn't unique, make it a two, and if that isn't unique, make it a three, etc etc. then you would have brownrob, brownrob1, brownrob2, greenfre, greenfre1, etc.

hope that helped.

Link to comment
Share on other sites

Create the fields:

prename (text)

lastname(text)

id (text)

g_counter (global number)

make a self relation on the field id

the script that will fill out the unique id will be:

Exit Record/Request

Set Field [id, Left(prename, 3) & Left(lastname, 6)]

Set Field [g_counter, 0]

Loop

Exit Loop If [Count(relation::id) = 1]

Set Field [g_counter, g_counter + 1]

Set Field [id, Left(prename, 3) & Left(lastname, 6) & g_counter]

End Loop

Have Fun

Gerd

Link to comment
Share on other sites

This topic is 7392 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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