Create list that contains variable number of elements

ngek

New Member
I have a list called "trip_segments" that have two locations, origination and destination. I want to be able to create "trips" that are a list of "trip_segments". Some trips may be just two segments, point A to point B and then point B back to point A. Others may have many segments. How do I create this type of structure with Fabrik 3.1?

THANKS!
 
I think you need a Repeat Group which will hold the points.

So if you have two records in the repeat group with points A and B, then the trip is 2 segments A-b then B-A. If there were 5 records with points A-E, the trip would be 5 segments long A-B, B-C, C-D, D-E, E-A.

S
 
Is there any way to automatically populate the next segment starting point with the previous segment ending point?

Should I create a list for the repeat group? Does that list need to contain a database join to the trip list record?

I tried this approach earlier and one huge downside was that the listing of the trip records showed a record for each segment so that a trip of 5 segments showed up as 5 trips! Any way to show as just one record?

In MS Access this would just be a form/subform but there doesn't seem to be a good way to do this in fabrik.

THANKS
 
Repeat Groups are the equivalent of MS Access sub-forms.

You can populate a new repeat group row using javascript and handle deleting of rows similarly.

However, if you just store a single point per repeat group row, you can infer the segments as I explained above without the need for clever javascript.

To make a repeat group you have two options:

1. Create a separate list with the foreign key and then create the join with the primary list manually.

2. Move the data which you want to repeat into a separate group on the same list - and then switch that group to being repeating - this will automatically generate a separate repeat table (without a separate list / form).

On the List / Data / Joins tab, there is a setting to say what happens in the list to the non-repeating parts of the row - the default is to show the non-repeating parts multiple times (which I think is what you are describing), but if you set a different value then you should get what you want - 1 trip with multiple segments.

S
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top