People sometimes ask if it is possible to use their own record ID for identifying Participants Database records. For example, the plugin is used to hold a customer database, and each customer has a unique customer ID. If you want to use this customer ID to identify records, you will need to make some modifications to how the plugin works.
We can’t simply repurpose the internal “id” that the plugin uses to identify records, that is designed to be independent and is set up to avoid conflicts and other issues when interacting with the database. It also strictly only allows the use of integers, and often the ID numbers you want to use are not simple integers. To use your own ID scheme, you need to define a field that is just for that purpose. Once you do that, you can use any identification scheme you want.
This tutorial provides a demonstration plugin you can use to implement your own custom ID scheme.
First Define Your ID Field
You will need to create a field to hold your record IDs. This can be a text field or a numeric field, the only real requirement is that it must be a unique value for each record. You can put this field into an administrative group if you don’t want the user seeing it. If you want them to see it, but not change it, make it a “read only” field in either a public or private (visible when editing the record only) group.
Once you have your ID field, you must populate it. Typically, this would be done with a CSV import where each record’s identifier can be imported and saved with the record. If you don’t have all your ID fields filled in with unique values, the plugin won’t work.
Setting Up the Plugin
There are two things you will need to customize to make the plugin work: the name of the ID field you created and the string you want to use in the single record URL to identify the ID value.
In this demo, the name of the ID field is “customer_id” and the “get” variable name is “custid.” With a setup like that, your single record link will look something like this:
That would show the record that has the value “001-284KL” in the “customer_id” column.
Here is a tutorial plugin you can download to get this set up. You will need to modify it to work for your particular setup. You can also use it as a starting point for your own custom plugin.