Many to Many trouble

mattlamb

New Member
Hi There,

I am having some trouble getting a many to many setup to work.

What I have :
List of Venues
List of Contacts
Because a Contact might belong to more than one Venues, And a venue might have more than one contact,
Contacts has repeating group with database join element to Venue.

So I have (simplified)

Venues :
id | VenueName | VenueAddress |

Contacts
id | ContactName | ContactPhone1 | ContactPhone 2

Contact_4_repeat
id | parent_id | Venue

What I want is on my Venue List detail view (I am using bootstrap_tabs) another tab showing Contacts, which list all contacts which have been tagged to this venue.

Can you please explain how this is meant to be done?
 
Last edited:
hi
What you are doing sounds correct, although I would need to see the join options to be able to tell you definitively, could you post a screen shot of that section of the list's settings
What is the specific 'trouble' you are having?
 
Thanks Rob, good to know I am on the right track.

What I am after is a database of venues, contacts, etc, with most things many to many.
I want to view the information as it relates to a venue - so when I view the venue detail , in tabs I also get the contacts, identified hazards etc.

Attached some screenshots.
First is my first attempt at using the content plugin in the intro of a group to display my filtered list from contacts. This is what I used in my into :
{fabrik view=list id=2 venue_db_contacts_4_repeat___Venue=[rowid] showfilters=0 layout=contacts show-title=0}
This works well :
UPDoX3V.jpg


But When you are editing the form, the intro text is not run through the plugin, so my users see the {fabrik view=...} code.

So I try the join like below : (the last join). It is from venue_db.id to venue_db_contacts.id

KAmocj9.jpg


The result of this is a group gets created Venues - [venue_db_contacts] which is set to repeat, but I only get one result, not the expected two.

QtHqkMa.jpg


My next question will be how to get a custom layout for just that one group so I can make the contacts appear as cards like my above example.

Cheers

Matt
 
See I think I need two joins? One to Contact_4_repeat to find out what venues the parents belong to, and one to Contacts to get the details.
Because above I have linked the Venue ID to the contact ID, but the contact ID does not relate to the venue.
 
Id perhaps start simple, as having 5 joins etc is going to get quiet confusing.
Looking at the last join I think that the "to column" looks wrong, normally that would be a field referencing the "from" table's primary key value.
In your case it looks like you have selected to "to" table's primary key which is going to be a unique value and might explain why you are only seeing one result
 
Hi Rob, the first 3 joins are automatically made for repeats groups in the list. they are ok. The 4th one is a one to many which is working ok too.

As you say, I am stuck on what to select on 'to'. because the key is in another table.. (not sure i'm saying this right)

I have table A. I want to take data from table B, based on the info from table C.

Table B doesn't contain any info on what its records relate to.

Table C contains the information on which Row in table B beloings to a row in Table A..

Clear as mud!!
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top