Posted on by

“Multiple Databases” with Participants Database

One of the most frequent support requests I receive for the plugin is: can it do multiple databases? Can multiple instances of the plugin be installed? To both questions, the answer is no, it’s not designed for that, but you can do a lot with this plugin and in most cases it’s not really necessary to have separate databases. All that’s needed is a way to differentiate more than one kind of record.

First of all, any kind of website that needs something like this is probably going to have complex functionality. It is not the kind of website that can be put together by installing a few plugins. It will require a good understanding of the user experience, how to help people interact with the site so it’s not confusing, and it’s going to require some knowledge of HTML, CSS and PHP.

The purpose of this article is to outline the task so you’ll have a better idea what’s involved and then you can determine whether you need to bring in coding help or not. The example I give later on in the article is simplified, and wouldn’t require any coding, but many real-world applications won’t be this simple.

Is Participants Database Enough for the Job?

When people ask about multiple databases, they usually have two or three different classes of thing they want to store in the database. In some cases one of those things would be better handled by another plugin or functionality.

For instance, let’s say you have some people signing up for a newsletter and some people offering their time as a volunteer. Participants Database is not well suited to managing a mailing list, so you would likely be better off using a newsletter plugin for your newsletter subscribers, and Participants Database for your volunteers: it’s much better suited for that. You may need to figure out how to handle it when a person wants to both volunteer and subscribe to the newsletter, but that will be a lot easier than trying to customize Participants Database to handle a mailing list.

Another common thing people want Participants Database to do is register users, then let those users do things like post messages or ads. In this case, you’re much better off creating a custom role and registering your users with your website as WordPress users, then letting your logged-in users post ads or whatever you are having them do to interact with Participants Database. Once again, no need for multiple databases there, and I’ve written an article describing how to do that: Using Participants Database with WordPress Users

Simulating Multiple Databases

In those cases where you have different, but similar things to store in the database, the Participants Database plugin can handle that pretty easily. That is done by setting up a field that is used to differentiate your records as being a member of a class. Let me show you one way to do that…

In this example, fairly typical of the kind of thing plugin users ask about, there is a kid’s sports team that expects the parents to be involved in various ways. You want the kids to sign up and give the needed info for their participation, but you’ll have a different set of questions for the parents. This means we have a page for the kids to sign up and another page where the parents sign up.

The key to this is a field that differentiates the records. For this, we create a field named “type” that will indicate whether the record is for a team member or a parent. Make this field a hidden field and set the default value to post->post_name. What this will do is record the name of the page the signup form was on. With that, you’ll be able to tell which form was used to create the record.

Setting up the Signup Forms

An easy way to manage your fields is with field groups. Since some of the fields for both the parents’ and kids’ records will be the same, it’s convenient to group those together…things like name, address, phone number, email address…and, importantly, our “type” field. We’ll call this group “contact.”

Now, we create two more groups for the rest of the questions: one for the kids and one for the parents. The kids one would have things like t-shirt size, left- or right-handed, preferred position, experience, etc. We’ll call that group “player.” For parents it’s things like how they’re willing to help, when they’re available, and who their kids are.

Now that the groups are defined, we can set up the signup forms. For the kids’ page, put something like this:

[pdb_signup groups="contact,player"]

For the parents, it’s

[pdb_signup groups="contact,parent"]

Pretty simple, huh? We now have two different signup forms.

This article provides some more detail in setting this up: Using Multiple Registration Forms

Administration

Maybe you need to be able to add administrative notes to the records, too. You can put those into another group, “administrative” that holds things like the payers status (active, pending, inactive). Keep the “display” checkbox unchecked on this group so it’s not shown on the website. You’ll be able to edit these fields in the admin.

Showing the Team Roster

Once you have the records, you can do different things with them depending on the type. For instance, to show the current team roster, you could use a shortcode like this:

[pdb_list filter="type=kids-signup&status=active"]

As you may have guessed, the page where the kids signup form is has the name (slug) “kids-signup.”

At this point, you have your basic working setup, and I’ve demonstrated the general idea behind getting the effect of multiple databases out of the one database that Participants Database uses. You can extend this idea to many different applications.

Showing the Record Detail for Different Types

You can set up a custom template that will show the single record differently based on what kind of record it is. This code shows a special single record template that chooses which shortcode to use based on the “type” value in the record:

You can also set up a record update form that will present different fields depending on the type: see the link below for instructions on setting that up.

Using Multiple Registration Forms

Here is an article that explains how to show a record edit form based on the type of record: Showing a Record Edit Form Based on a Value in the Record

61 thoughts on ““Multiple Databases” with Participants Database

  1. I am sorry if I am interrupting this convo but firstly, Roland , thank you for a great plugin for wordpress. I want to create two forms for two separate events that are in no way related but, participants are 2 different lists. How do i create two databanks+short codes that store these 2 separate lists?

    1. It’s not possible to create two separate databases, but you can set up the single database to be used two different ways. Take a look at this article for an explanation:

      “Multiple Databases” with Participants Database

    2. Sorry, I didn’t notice that you were commenting on the article I recommended. Maybe you can be a bit more specific about why what is explained here doesn’t work in your case.

  2. I use this plugin to have participants sign up to enter a parade for a festival. I want to add the ability on a different form to sign up for our soapbox derby. I think I have the groups and such working to present different questions to each form and to track the form it was submitted on.

    My issue is now to figure out how to send different emails on signup. We have been sending out parade info by default Now I want to send out parade info(start time, staging area, etc) to parade folks but different info to the soapbox derby folks. I don’t see how to do this? Is there a way? I would also like to direct the new parade float emails to our parade coordinator and the soapbox entries to the soapbox coordinator?

    1. Something like this will requre the use of the Email Expansion Kit add-on. This plugin provides a way to define multiple email templates that can be triggered under specific sets of circumstances.

      For example, in your application, there would be two email templates that are set up to trigger when a signup is submitted. In the submitted data, there needs to be a value that tells the plugin which form was used. You would use that value to determine which email template is used for the email. This can include both the user’s receipt email and the admin notification email.

  3. Is it possible to extract data from one record and data from a second record and then combine them to display on a custom template?

    Example with your child/parent tutorial above.

    Is it possible to extract the child’s details from his record (added using the child sign up form) and then extract the parent’s details from their record (added using the parent sign up form), and display it in a customised template?

    I’m guessing that [pdb_record fields="childs_name, childs_age, parents_name, parents_skill"] would not be doable because there is two different record ID’s to refer to, but I maybe incorrect.

    If it is undoable, do you know if it is possible to store the child’s data as a global variable/s, then use a custom template display the parents data [pdb_record fields="parents_name, parents_skill"] and then retrieve the stored global variable/s to place into that template?

    I am not proficient at coding yet but I do have a programmer who is available in his free time so I am exploring possibilities before connecting with him.

    Thanks Roland

    1. This is possible, it will require some php coding skills by someone who is familiar with the WordPress code environment, and certainly some HTML/CSS layout skills.

      The technique I recommend is to build a custom template that displays shortcodes. The way this works is when the single record page for a parent record is opened, your custom template will show that record using a shortcode but it will also show the child records by invoking the single record shortcode for those records too. The template takes the ID of the parent record, then uses that information to discover any child records that are associated with it. (no need to use globals) It then displays each of those child records using a single record shortcode. Template can display shortcodes by using the do_shortcode WordPress function.

      1. Thank you Roland, we were able to get the two records to merge following your advice. We have another question arising from this combined record display.

        Is it possible to have a dropdown list to populate field in the PDb database?

        Example: The child has already been signed up. When the parent signs up, there would be a dropdown field on the “Parent Sign Up” page that would populate the “Child’s Name” field from the database and the parent could select their child’s name.

        I would guess that if it is possible, that we would use the Manage Database Fields to create the Dropdown Field in the Parents Field Group. Then we would use the Attributes options to adding coding to target the Child’s Name field? Would this be
        possible?

        Thanks for your quick responses

        1. Yes, I have an article which provides a way to do something like this. You’ll need to modify it to do the exact thing you want, but it’s possible.

          Populate a Form Dropdown from the Database

  4. I have a bit of a different need. I am setting up a genealogy website which has obituary indexes, probate record indexes, and cemetery indexes. The common fields would be first and last names. The other fields would be specific to that type of record. Is this something that could be managed in one database and then using a search shorcut, be able to post a filtered search on obituaries for the Obituary page, cemeteries for the Cemeteries page, etc. The results would ideally show just the name and entry for that page, like obituary. Thanks.

    1. This is easily done using shortcode attributes where each page would have a shortcode that is set up to display only that one type of record. You can also control which fields are shown on each page. You will need to have a field that designates the type of record, then you can filter by type to get the different displays.

  5. Hi, thanks for this article!

    I want to use this for three kinds of participants. I have created different groups and different list (grid) views. But because of the title of the groups i like to use totally different fields including the photo.
    That gives a problem because only the original photo field links to a single record.
    Is there a solution for this problem?

    And also i have trouble with using a custom template for Showing the Record Detail for Different Types. In with folder do i have to put this template to work?

    Thanks & Kind Regards, Simone

    1. The templates will normally go into your child theme folder in a folder named “templates” but if you’re not using a child theme, it is better to download and use the Custom Template plugin, which gives you the option of putting your custom templates in the uploads folder. This is explained in the plugin instructions.

      For the single record link, you can determine which field gets the single record link in you custom template. You can use the Template Helper Class ti make that a bit easier. Another approach would be to use a placeholder field for the link, so it could be the same field for all your displays.

  6. Hello, im building a database for worker. They can sign up, this part is ok. My problem is that i have to assign the employer details as well. The employer has ca. 10 extra info i need to link to the worker. What i would like to do is:
    1., Worker sign up fill data. OK
    2., Employer sing up fill data. (multiple sign up forms)
    3., Administrator will should be able to select from a drop down list and assign the Employer to the Worker.
    4., Exporting worker data to csv all the Employer data should be there …

    is it possible somehow?

    1. Yes, you will need some coding skills and write your own custom code to get this done. You will need to create a selector for the employers that can be selected in the worker’s record. When the worker’s record is updated, your custom code checks the value of the employer selector and then transfers that employer’s data to the worker’s record. You can use the pdb_after_submit_update action for this. The action handler gets the data from the worker’s record, then you can use that to add the employer’s data tot he worker’s record.

      1. Hello, would this also be the correct way to go for a hierarchical setup? My need is to have an Agency Record with multiple Agency Programs attached to it.

        Agency One
        –Program 1
        –Program 2
        –Program 3

        Agency Two
        –Program 1
        –Program 2

        Agency Three
        –Program 1

        Thank you again for this excellent plug-in.

        1. What you’re asking about is a relational database, and Participants Database can’t do that. What this article is talking about is two separate databases, the records in each segment don’t relate to each other.

  7. I want multiple databases-one will be a mailchimp integration, but the two have no common fields-do I need to create a dummy group, just to add a type field? There won’t be a registration form-I’ll make all the changes in admin.

    1. You can do it as long as you understand that it really isn’t more than one database. You need a field to differentiate the different types of record, and then you need to use that field to filter out the unwanted type in different contexts.

  8. I’m interested in using the Mailchimp integration plugin. I currently have a participation database with information on our club’s events. I also want a member directory available to my wp site. Mailchimp doesn’t seem to have the capability to let a current user of my site see the information in the Mailchimp database. If I buy the plugin, does it actually sync the Mailchimp fields to the participation database? If yes, then I can show the membership directory on my website. Our website is http://ras2.teebark.com, and the participation database is under Venues.

    1. Never mind-I found the mailchimp docs elsewhere on your site.

  9. Hi, can I have only one registration side and then automatically send out two different single-signup-forms in the registration mail, depending on the answer in the registration page , i.e. radio button: answer A leds to Signupform A, answer B leds to signupform B. I do not want to have to different signup pages like in your player/parents example.
    Or can I put two registrationforms on one page and use the hidden field with post->post_name (or any other variable?) to give out an anchorname (or other?) of one of the regforms?
    Great Plugin, by the way, can’t say this often enough!

    1. In a case like that, you don’t need the hidden field, the value of the radio button selection will identify the type of registration it is.

      If you want to send out different emails for each one, you’ll need to install the Email Expansion Kit add-on that gives you the ability to use a value like that to determine which email template is used to send the email.

      1. Hi I have a related question: Let’s say I have a sign up form that has multiple email address fields, for a group of people signing up together. Would this add-on allow me to send message to all these addresses?

        1. Yes, you can put a comma-separated list of email addresses in the recipient field.

  10. how can I delete multiple records or even a whole list in my database?
    I know I can select a record field and then delete the record, but if you have for ex. 100 records ready to be deleted it takes a lot of time to select each record by hand.

    1. It is possible to set up the admin participant list to show a large number of records, then use the “select all” to select then delete the records listed.

Leave a Reply to Matt Cancel reply

Your email address will not be published. Required fields are marked *

Would you like to be notified of followup comments via e-mail? You can also subscribe without commenting.

61 thoughts on ““Multiple Databases” with Participants Database

  1. I am sorry if I am interrupting this convo but firstly, Roland , thank you for a great plugin for wordpress. I want to create two forms for two separate events that are in no way related but, participants are 2 different lists. How do i create two databanks+short codes that store these 2 separate lists?

    1. It’s not possible to create two separate databases, but you can set up the single database to be used two different ways. Take a look at this article for an explanation:

      “Multiple Databases” with Participants Database

    2. Sorry, I didn’t notice that you were commenting on the article I recommended. Maybe you can be a bit more specific about why what is explained here doesn’t work in your case.

  2. I use this plugin to have participants sign up to enter a parade for a festival. I want to add the ability on a different form to sign up for our soapbox derby. I think I have the groups and such working to present different questions to each form and to track the form it was submitted on.

    My issue is now to figure out how to send different emails on signup. We have been sending out parade info by default Now I want to send out parade info(start time, staging area, etc) to parade folks but different info to the soapbox derby folks. I don’t see how to do this? Is there a way? I would also like to direct the new parade float emails to our parade coordinator and the soapbox entries to the soapbox coordinator?

    1. Something like this will requre the use of the Email Expansion Kit add-on. This plugin provides a way to define multiple email templates that can be triggered under specific sets of circumstances.

      For example, in your application, there would be two email templates that are set up to trigger when a signup is submitted. In the submitted data, there needs to be a value that tells the plugin which form was used. You would use that value to determine which email template is used for the email. This can include both the user’s receipt email and the admin notification email.

  3. Is it possible to extract data from one record and data from a second record and then combine them to display on a custom template?

    Example with your child/parent tutorial above.

    Is it possible to extract the child’s details from his record (added using the child sign up form) and then extract the parent’s details from their record (added using the parent sign up form), and display it in a customised template?

    I’m guessing that [pdb_record fields="childs_name, childs_age, parents_name, parents_skill"] would not be doable because there is two different record ID’s to refer to, but I maybe incorrect.

    If it is undoable, do you know if it is possible to store the child’s data as a global variable/s, then use a custom template display the parents data [pdb_record fields="parents_name, parents_skill"] and then retrieve the stored global variable/s to place into that template?

    I am not proficient at coding yet but I do have a programmer who is available in his free time so I am exploring possibilities before connecting with him.

    Thanks Roland

    1. This is possible, it will require some php coding skills by someone who is familiar with the WordPress code environment, and certainly some HTML/CSS layout skills.

      The technique I recommend is to build a custom template that displays shortcodes. The way this works is when the single record page for a parent record is opened, your custom template will show that record using a shortcode but it will also show the child records by invoking the single record shortcode for those records too. The template takes the ID of the parent record, then uses that information to discover any child records that are associated with it. (no need to use globals) It then displays each of those child records using a single record shortcode. Template can display shortcodes by using the do_shortcode WordPress function.

      1. Thank you Roland, we were able to get the two records to merge following your advice. We have another question arising from this combined record display.

        Is it possible to have a dropdown list to populate field in the PDb database?

        Example: The child has already been signed up. When the parent signs up, there would be a dropdown field on the “Parent Sign Up” page that would populate the “Child’s Name” field from the database and the parent could select their child’s name.

        I would guess that if it is possible, that we would use the Manage Database Fields to create the Dropdown Field in the Parents Field Group. Then we would use the Attributes options to adding coding to target the Child’s Name field? Would this be
        possible?

        Thanks for your quick responses

        1. Yes, I have an article which provides a way to do something like this. You’ll need to modify it to do the exact thing you want, but it’s possible.

          Populate a Form Dropdown from the Database

  4. I have a bit of a different need. I am setting up a genealogy website which has obituary indexes, probate record indexes, and cemetery indexes. The common fields would be first and last names. The other fields would be specific to that type of record. Is this something that could be managed in one database and then using a search shorcut, be able to post a filtered search on obituaries for the Obituary page, cemeteries for the Cemeteries page, etc. The results would ideally show just the name and entry for that page, like obituary. Thanks.

    1. This is easily done using shortcode attributes where each page would have a shortcode that is set up to display only that one type of record. You can also control which fields are shown on each page. You will need to have a field that designates the type of record, then you can filter by type to get the different displays.

  5. Hi, thanks for this article!

    I want to use this for three kinds of participants. I have created different groups and different list (grid) views. But because of the title of the groups i like to use totally different fields including the photo.
    That gives a problem because only the original photo field links to a single record.
    Is there a solution for this problem?

    And also i have trouble with using a custom template for Showing the Record Detail for Different Types. In with folder do i have to put this template to work?

    Thanks & Kind Regards, Simone

    1. The templates will normally go into your child theme folder in a folder named “templates” but if you’re not using a child theme, it is better to download and use the Custom Template plugin, which gives you the option of putting your custom templates in the uploads folder. This is explained in the plugin instructions.

      For the single record link, you can determine which field gets the single record link in you custom template. You can use the Template Helper Class ti make that a bit easier. Another approach would be to use a placeholder field for the link, so it could be the same field for all your displays.

  6. Hello, im building a database for worker. They can sign up, this part is ok. My problem is that i have to assign the employer details as well. The employer has ca. 10 extra info i need to link to the worker. What i would like to do is:
    1., Worker sign up fill data. OK
    2., Employer sing up fill data. (multiple sign up forms)
    3., Administrator will should be able to select from a drop down list and assign the Employer to the Worker.
    4., Exporting worker data to csv all the Employer data should be there …

    is it possible somehow?

    1. Yes, you will need some coding skills and write your own custom code to get this done. You will need to create a selector for the employers that can be selected in the worker’s record. When the worker’s record is updated, your custom code checks the value of the employer selector and then transfers that employer’s data to the worker’s record. You can use the pdb_after_submit_update action for this. The action handler gets the data from the worker’s record, then you can use that to add the employer’s data tot he worker’s record.

      1. Hello, would this also be the correct way to go for a hierarchical setup? My need is to have an Agency Record with multiple Agency Programs attached to it.

        Agency One
        –Program 1
        –Program 2
        –Program 3

        Agency Two
        –Program 1
        –Program 2

        Agency Three
        –Program 1

        Thank you again for this excellent plug-in.

        1. What you’re asking about is a relational database, and Participants Database can’t do that. What this article is talking about is two separate databases, the records in each segment don’t relate to each other.

  7. I want multiple databases-one will be a mailchimp integration, but the two have no common fields-do I need to create a dummy group, just to add a type field? There won’t be a registration form-I’ll make all the changes in admin.

    1. You can do it as long as you understand that it really isn’t more than one database. You need a field to differentiate the different types of record, and then you need to use that field to filter out the unwanted type in different contexts.

  8. I’m interested in using the Mailchimp integration plugin. I currently have a participation database with information on our club’s events. I also want a member directory available to my wp site. Mailchimp doesn’t seem to have the capability to let a current user of my site see the information in the Mailchimp database. If I buy the plugin, does it actually sync the Mailchimp fields to the participation database? If yes, then I can show the membership directory on my website. Our website is http://ras2.teebark.com, and the participation database is under Venues.

    1. Never mind-I found the mailchimp docs elsewhere on your site.

  9. Hi, can I have only one registration side and then automatically send out two different single-signup-forms in the registration mail, depending on the answer in the registration page , i.e. radio button: answer A leds to Signupform A, answer B leds to signupform B. I do not want to have to different signup pages like in your player/parents example.
    Or can I put two registrationforms on one page and use the hidden field with post->post_name (or any other variable?) to give out an anchorname (or other?) of one of the regforms?
    Great Plugin, by the way, can’t say this often enough!

    1. In a case like that, you don’t need the hidden field, the value of the radio button selection will identify the type of registration it is.

      If you want to send out different emails for each one, you’ll need to install the Email Expansion Kit add-on that gives you the ability to use a value like that to determine which email template is used to send the email.

      1. Hi I have a related question: Let’s say I have a sign up form that has multiple email address fields, for a group of people signing up together. Would this add-on allow me to send message to all these addresses?

        1. Yes, you can put a comma-separated list of email addresses in the recipient field.

  10. how can I delete multiple records or even a whole list in my database?
    I know I can select a record field and then delete the record, but if you have for ex. 100 records ready to be deleted it takes a lot of time to select each record by hand.

    1. It is possible to set up the admin participant list to show a large number of records, then use the “select all” to select then delete the records listed.

Leave a Reply to Matt Cancel reply

Your email address will not be published. Required fields are marked *

Would you like to be notified of followup comments via e-mail? You can also subscribe without commenting.