Update 1/16/19: this plugin had to be rewritten to work with versions of Participants Database later than 1.8.0.
I often get questions about how to set up member IDs in Participants Database. It is possible to use the built in “id” or “private_id” fields, but in most cases, you’ll want to be able to generate your member IDs yourself according to your desired format.
I am providing a working example plugin, which you can customize to your purpose, or use it as-is. It just assigns a number as the ID, and whenever a new record comes in, it gives it the next number.
You can change the part that assigns the new ID with your own formula for determining the member ID if you want to use a custom format.
Setting Up the Member ID Field
The member ID field needs to be set up in your Participants Database fields. You can set it as a “text-line” field or “numeric” if you just want consecutive numbers for your IDs. Configure it to be “read only” if you don’t want the user changing it.
The plugin code sets the member ID in the background after the form is submitted so it doesn’t need to be included in the signup form.
I’m including a plugin that sets up a simple member ID field functionality: it starts with 1000 and then every new record added after that gets the next number in the sequence. You can easily adapt this to other kinds of member ID schemes if you know how to do that in php.
Download this plugin by clicking on the filename at the bottom of the code window. It will take you to a page where you can download the zip file. The zip file can be easily installed on your site by using the “Plugins/Add New” item in the admin, then clicking on the “Add New” button at the top of the page.
Be sure to edit the plugin file so that the $id_field variable has the name of your Member ID field.
This plugin will also automatically add a member ID to records that don’t have one when they are updated.