I’m developing a prospecting solution with three related tables: the Campaigns table, the Leads table, and the table that links Campaigns to Leads.
I need to create a screen where the user can access the campaign, and within the campaign, they can filter, select, and link leads to that campaign.
The solution I found was to create a tab within the campaign table, insert the leads table, and create a custom request button to add leads to the campaign.
However, I ran into two problems:
1 - I can’t pass the campaign ID in the custom request, only the Lead ID.
2 - If I select more than one lead, the JSON is generated as an array and then the request displays an error.
Hi, just to clarify — the Record Picker does support filter and multi-selection, and it’s well suited for your use case where you’re managing a many-to-many relationship between campaigns and leads.
Your tips have been very helpful, thanks for sharing.
But I’m still having problems. According to my tests, the field only allows selecting multiple records if the relationship is many-to-many. If the relationship is many-to-one, it doesn’t allow selecting multiple records.
Okay, in my scenario, I have the following database structure:
campaign.ID - 1 / N - campaign_enrollments.campaign_id
leads.ID - 1 / N - campaign_enrollments.leads_id
In other words, I already have a link table called campaign_enrollments.
According to the documentation, I should create it like this:
But I’ve already tested it and it doesn’t work correctly. Doing it this way creates two fields in the campaign_enrollments table, but these fields aren’t available when I insert the table into the frontend.
The only way I managed to get it to work to select multiple records was like this:
Doing it the way above creates two new link tables linking the campaign_enrollments ID to campaign.id and another linking the campaign_enrollments ID to lead.id, making this many relationships unfeasible.
Another question that I also couldn’t find in the documentation is how to make the frontend table show one record per line instead of separating them with commas.
Can you show a screenshot or explain how you added the table?
Another question that I also couldn’t find in the documentation is how to make the frontend table show one record per line instead of separating them with commas.
I recorded a video showing how I’m creating the many-to-many relationship through the campaigns collection, using the campaign_enrollments collection as the link table.
Note that it creates the camp_id and lead_id fields in the campaign_enrollments collection correctly, but when I go to the frontend to add a campaign_enrollments table, the fields aren’t available.
It actually worked, but is there any way to make these camp_id and lead_id fields available for use?
I need them for filters and updates.
For example, I need to create a popup that displays details from the campaign_enrollments table, filtering by lead_id and camp_id from the parent popups.
If there was a way to use the many-to-one relationship directly in the campaign_enrollments table, it would work, but when I use it, it only allows me to select one record at a time.