Custom Action "Unique ID" based on other fields?

janfestjens 20 Aug, 2013
Hi,

I would like to create a Unique ID for every user which is registrating. This should be based on the birthdate (YYYYMMDD) plus a number between 001 and 999. So YYYYMMDD-XXX where XXX is the next number available for that birthdate.

I've looked at the Unique ID action, but I can only give it a template, or is it possible to add a variable? So I can first change the birthdate (which is provided as DD-MM-YYYY) to YYYYMMDD?
GreyHead 20 Aug, 2013
Hi janfestjens,

The Unique ID does as you describe - generates a random string* using a template.

Your codes are not random so the action probably doesn't help.

You can easily enough use a Custom Code action to do a check on the last entry in the database LIKE YYYYMMDD%, extract the serial number and increment it to build your new number.

Bob

* The reason for using random identifiers is that it makes it much harder for someone to guess what other codes might be valid whereas if you see a URL with &id=086 it's a fair chance that 085 and 087, etc. are also valid.
This topic is locked and no more replies can be posted.