Same form different lists

madpato

Member
Hello

I currently have a tabbed form with 5 groups but i am noticing that all of them are writing to the same table (since they all point to the same form), i do not want this since the table later will be huge so i want to split some data to other lists, but i dont find a way to relate a group to the same form but to write in another list (or db table). Since the group is associated to the form and the form to a single list.
Any way i can do this?

Thanks.
 
Yes.

You'll need to create a separate List (and hence table) for each group. Move each the group to the new Form (using the group settings) that gets automatically created for the new List. In each new group (once moved to the new form/list) add a join element, called something like parent_id, the 'value' for which which points back to the PK element for the main table (probably the 'id' element, if you created the main table with Fabrik). The label can be whatever makes sense, given the content of your main table. This will be the FK (foreign key) element, which is what relates the new 'group' to the main table.

Then in your main List settings, in the data tab, for each new "group" (now a separate table), add a join. From the main table's PK ('id'), to the FK you created on the new table. Do NOT set this to "repeat".

You should then have a separate table, as a one-to-one join, for each of the groups you split out.

I'd suggest doing a database backup before doing this. Although it should work, I haven't actually tested moving an entire group form one form to another in a while, and it's that kind of thing which can get messed up, if it hasn't been used or tested for a while. It's not something people do very often, as once a group is created, it usually stays where it is.

-- hugh
 
I have done this but i see one odd problem, i get a duplicate group and elements and if i add an item on the new group its also added on the old one, i suppose i should delete it? also they have the same id so if i delete one the other is deleted as well, the process works but this situation confuses me a bit, can you help me?

Thanks.
 
that's expected behaviour. Lists forms and their groups represent the fields in the underlying database table. So if you have two fabrik lists pointing to the same database table, and you add a field to one of those lists, that field is also added to the other list.
If that field is not needed in the other list,the simplest thing would be to unpublish (not delete) the element.
 
Guess i can live with that, my only concern is that this will not be writing twice to the database? (i am doing some tests right now)
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top