Jump to content
  • 0

How to create unique IDs based on users names?


Felix
 Share

Question

Hi everyone,

I want to create 'user friendly' IDs using names to create unique IDs. eg. John Smith would SMIJ01, and the second John Smith would be SMIJ02

Can anyone point me in the right direction as to how to do this with triggered actions?

Thanks!

EDIT: I'm not sure how robust it is but think I figured it out.

Created an 'ID building block' column

This is populated by a 'update #inserted' trigger action (concatenate first 3 letters of last name and first letter of surname)

Then immediately followed by a second 'update #inserted' trigger action to concatenate the 'building block' with a count of pre-existing blocks that match. Creates a series of unique IDs based on the surname/first name.

If anyone has a more elegant solution I would love to know :)

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi @Felix,

What I did was add a formula field and use left and right text function and set the field as unique:

Combining the first character of the First Name field and the last character of the Last Name and combined the autonumber value:

Sample formula: Left([@field:FirstName], 1) + right([@field:LastName], 1) + CONVERT(VARCHAR, [@field:ID])

image.png.9bfd7e8549bee8f67c38f54ad563efd6.png

 

Hope this helps

Link to comment
Share on other sites

  • 0

Hi @Felix

You can actually just have one update block that determines the value of the unique username, so that if its the first instance of combination, 1 will be appended to it, and if not, it will be appended by the number based on the number of existing records that has the same combination, plus 1.

 

Hope this helps!

 

13193931_createuniqueusername.thumb.png.1a8cf39816eea7eb5bdbe8e473ea0277.png

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...