Reusing a group of elements across different forms/lists/data tables

austega

Member
I am using Fabrik to support a range of issue based polls each with its own form, list and data table. Each form/list has two groups of elements, one of issue based question elements specific to the issue and the other of elements containing background demographic questions about the voter. This last group is common to all of the polls.

Can I copy this background factors group and its elements from an existing form/list/data table to another I have just created? Or can I create such a group outside of an existing form/list/data table (ie their settings and metadata) and then import this into each specific forms/lists that I create for each poll?

My reading of/experience with the Copy function that appears on the Elements tab is that such a copied element in a new form/list still refers back to the original data table.

The best way I think I have found so far is to do the following:

1. Create a new "template" form (not associated with any list or data table)
2. Create a group (called say Background) that is linked to this form, including the group label etc
3. Create the common background factor elements in this group
4. For each new poll, create the list (and thus data table and form and default group)
5. For this poll form, create a second group called Background-xyz
6. Go to an element list of the Background group and Copy all the elements (except id and date-time) to the new Background-xyz group

An advantage of this seems to include that any subsequent change to Background group or element labels can be propagated throughout all the polls (provided the copied elements are still linked to their original elements).

A disadvantage is that this process is error prone and manually intensive with no apparent ability to do a batch copy of elements (each needs to be individually allocated to the new group).

So questions:
1. Is there a better way?
2. Are there any dangers in the above approach that I need to be aware of?
 
Well, it rather depend son whether you are trying "normalize" your data or not. In other words, do you want that "background" group to be in its own table, "related" to several other tables, or do you simply want the fields repeated in each poll table?

-- hugh
 
Hi Hugh,

I want the background question data to be in the relevant poll data table, not in its own table.

My main concern now is making the creation of the poll list/form/groups/data table as efficient as possible with the resulting user experience as simple and consistent as possible.

David
 
OK. Well, you should just be able to copy elements between forms. Have the group you want them elements to go in to on the target form created, and when you copy, it'll ask for the group to copy them to.

Once copied, they will be "linked" to the one you copied from and inherit and changes you make to the original's settings, until you explicitly unlink them. So I'd suggest you create a "master" form for those, which you just use for copying from and tweaking settings on.

I dont know what your work flow is, but if the same people are going to be filling out multiple poll forms, you really might want to consider having that data in it's own table, with a one-to-one join. Or maybe a separate form they fill out once, and can then use the "autofill" plugin on poll forms to automatically populate each poll form's background data - that way you get your aim of having the "background" data separately in each poll form, but the convenience for the user of not having to fill in the same data repeatedly, and the ability to fill it in as defaults, but change it in each poll form.

-- hugh
 
Just FYI, waaaaay back when, in 1.x, we used to have the concept of "reusable" groups you could just assign to a forms, but managing that programatically was a nightmare, so we dropped it when we built 2.x, and focused on database joins instead.

-- hugh
 
this could again be possible after 3.5 is out when we move the meta info (groups elements etc) from being stored in the db to being stored in json files
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top