Repeat element

karlis

Member
I recently converted a rather large db from Access to SQL and am using Fabrik to make my life easier.
My question is not covered in the wiki about repeated elements/groups.
The questions is about three tables.
The first is "Retreats" the second is "Participants/duties" and the third is "Person".
Retreats<-one---many->Participants/duties<-many---one->Person(as a menu in Participants).
I have a form for Retreats with a group Participants/duties, where I can choose who is attending and what they will be doing. Simple enough.
But when I add a new Participant, I have to also specify which retreat, even though Partiipants/duties is a group of Retreats.
Any ideas?20171120_211550.jpg
 
Just for clarity -- I looked at the tutorials about students/classes, but that didn't seem to solve my problem.
 
Probably the way to do it is to create the three lists separately, rather than creating a participant-retreat group in the retreat form. So delete that repeat group.

Then create a person_retreat list (I'm renaming it because it makes more sense in my head than participant_retreat) which has:

id (the PK)
retreat_id (hidden field, set to format Integer so it saves as an INT)
person_id (join element to person table, value = id, label = name)
duty (whatever ... dropdown, or a join to a duty table, I'd probably go with a join, just because)

Then on the retreat list settings, Data tab, add a Join, from retreat.id to person_retreat.retreat_id, and set it to Repeat.

You should then have a repeat group on the Retreats form where the retreat_id is set automagically, and you get to choose the person and the duty.

You could also set "Front end add" on the person_retreat.person_id join element, so you get a + button you can add more people with.

-- hugh
 
I did as you recommended, but when adding a new person & duty the retreat does not show up automatically, but shows "please select".
 
The retreat shouldn't show at all, if you followed my suggestion and created it as a hidden field, not a join.



Sent from my HTC6545LVW using Tapatalk
 
Yup, the "join to" field in a list join (the Foreign Key on the 'child' table) can't be a database join element, as that messes up the automagic assignment of the FK value to the repeated group.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top