Add multiple records from 1 Add Form

gcopping

Member
I want to know if it is possible to have 1 Add Form which would enable multiple records to be added to the db. For example I want to be able to add Records A, B and C from 1 Add Form instead of having to add them 3 times individually.

Any help greatly appreciated or being pointed to some training which might show me how to do this.

Thanks,

Gary
 
I looked at wiki this is what is there...
Clone form plugin
Clone form plugin
  • Form-plugin-clone-30x.png


    The clone plug-in will, when the form is submitted, create additional copies of the submitted data in the database.
    • Clones - the field which contains the number of cloned records to create. This value includes the initial/main form submission. So if this field contains a value of 2 then one copied record will be created.
    • Batch ID - Select which field should store a reference to the initial/main submission primary key value. This is an optional parameter.
  • _____________________________________________________________________________________________________
I tried the plugin to test..
Now when I click on Clones.... I get a listing of the table fields, not numbers, as expected. (see attached)

I would be interested if the Clone plugin would allow the selection of the elements and their corresponding values to be cloned to a selected table where the attributes are the same. Here it seems that this only duplicates the values but places them in the same table. Is that a correct assumption?
 

Attachments

  • 12.10.2022_13.20.00_REC.png
    12.10.2022_13.20.00_REC.png
    103.2 KB · Views: 38
... Here it seems that this only duplicates the values but places them in the same table. Is that a correct assumption?
Yes. A clone is a copy, in this case of the submitted data, and that's what the clone form plugin does, as per Wiki.

What you seem to be wanting could be the log form plugin (= a "newer/better" version of the logs form plugin), or perhaps the upsert form plugin.

Anyway, perhaps don't hijack someone else's thread for your specific/different requirements? So, for more on that better start a new thread for your needs? Thanks. ;)
 
Last edited:
Yes. A clone is a copy, in this case of the submitted data, and that's what the clone form plugin does, as per Wiki.

What you seem to be wanting could be the log form plugin (= a "newer/better" version of the logs form plugin), or perhaps the upset form plugin.

Anyway, perhaps don't hijack someone else's thread for your specific/different requirements. So, for more on that better start a new thread for your needs? Thanks. ;)
Settle down here... This is not a hijack I simply was adding to the conversation regarding the Clone plugin. It seems that the wiki and or the clone is not correct.

I think Troester's second suggestion was more appropriate since the OP stated
"I want to be able to add Records A, B and C from 1 Add Form" Which implies 3 different sets of values A, B, C.

To further my understanding of the Clone plugin I tested it... that is when I noticed that when I selected the Clone fields on the plugin it provided a list of fields in the table for the form I was testing the plugin with, which I thought that would be cool and wondered if this was a work in progress upgrade.

I then made a commentary...
What you seem to be wanting could be the log form plugin (= a "newer/better" version of the logs form plugin), or perhaps the upse(r)t form plugin
Thanks for these suggestions...I was not looking for a solution only an understanding of the Clone plugin... but these I have not used ... I will take a look!
 
Last edited:
To clarify:
(1) Multiple records of the same data in the same table: clone form plugin.
(2) Multiple records of different data (or the same - depending on user's choice) in the same table: repeatable group.
(3) Single copy of the same data in a different table: either log(s) or upsert form plugins, depending on specifics.

(1) or (2) seems to be what the OP @gcopping wants.
(3) seems to be what @cheyennemtnman wants.
 
Actually, I am not wanting at this moment.. I was curious is all... Seeing how the clone plug-in responded when I selected the clone attribute and the list of field names dropped down, instead of a number, only then did i think to make my commentary.
 
OK I have looked at both the Clone plugin and Repeat in Groups. I must admit, from the documentation on Wiki, I am struggling to understand how either of these work and what they do. From the comments above it looks like I need Repeatable Group. However under the Template Selection on this I only have the options of List or Table and what I want to repeat is the whole Form.

In case you have misinterpreted my requirement I will try to be more clear.

I have a Form for an Angling Club where members can add details of their Catches for that day. At the moment, using the Form, they can add a single Catch. If they have multiple Catches for that day then they have to cycle through the form X times for X Catches. They would like to be able to add multiple Catches from one form without having to cycle through the Form X times. I have told them that they need to specify how many Catches they would like on each Form because it, obviously, cannot be unlimited. So we are probably talking about a Form with the ability to add 3 Catches.

Does this help to understand my requirement? Is it possible in Fabrik to do this?

Any help greatly appreciated.
 
A repeatable group is it then.

Simply put, you want all elements which the user should be able to enter multiple times in the same form to be in the same group. Then set that group to repeatable as per http://fabrikar.com/forums/index.php?wiki/groups/#repeatable, eventually limit it to a "Repeat max" number, etc.

In your case, it means that it'll be the elements relevant for a Catch. Just as an example, I imagine that could be something like
- Catch day & time
- Location
- Type of fish
- Weight
- Length

Other elements, e.g. if you have a (hidden or not) user element and/or a (hidden or not) jdate element to record who filled in the form and when, the ID etc, you leave out of the repeatable group and keep them in another one which remains not repeatable.
 
Thanks for your input. I have tried this in the Group but have the following issues:

1. Do I set the Template to List or Table?
2. When I enter the Repeat Element "Caught" I get the Notice message "You can not set the group containing the list primary key to be repeatable" and it isn't saved as Repeatable. But this is not a primary key. Even when I don't get this message for an Element the button Repeatable is switched to No when I save so I can't save it as Repeatable.
3. There only seems to be the ability to enter 1 element as Repeatable - how do I enter all my other Elements?
4. I also have more fields on my Group form than is shown in the documentation - Repeat Num Element, Sortable, Order Element, Min/Max Err Msg, No Data Message, Introduction - so it looks like the documentation is not up to date.

So, all in all, I am still very confused as to how to get this to work. Any further help greatly appreciated.
 
1. + 4.: Hover over the field labels to see tooltips with explanations. In case of doubt: trial & error.
2.: No idea... what element type is "Caught"? Can't say more without (many?) more details.***
3.: As said before:
...you want all elements which the user should be able to enter multiple times in the same form to be in the same group. Then set that group to repeatable...
So, you may need to double-check which element is in which group and make sure that the right ones are in the repeatable group... and eventually only the right ones.

*** Perhaps you could post a screenshot of your element list filtered by the form in question, plus the information which is the group set to repeatable.
 
Thanks again.

2. Have attached a screen shot of the fields available. As I said I can't make the Group Repeatable when I save it just resets the Repeatable button to No. I am trying to do this against a Group called My Catch returns which is what is used to currently to capture the information. Do I make this Group Repeatable or should I be creating a new Group?

3. Yes I understand this but can't find a way of adding more than 1 element to the Group - how do I do this?
 

Attachments

  • screen.PNG
    screen.PNG
    248.8 KB · Views: 37
2. Again, read the tooltips, also for "Repeat Num Element". Hence, leave that empty.
The screenshot was helpful for telling you this, but not the one I've asked for.

Again, what would be helpful is a screenshot of your element list for the form in question:
Fabrik backend -> (in the sidebar) Elements -> Filter: select the form. Then a screenshot of the complete page.

3. You edit the elements. There you have a selector for "Group".
 
Guys, good morning...

Sorry for intruding on the subject, as I don't understand that much...

But from my point of view, wouldn't it be better and easier to create two tables (one for registered fishermen and another for the number of catches) and linking the two tables???...

I, for example, have an employee registration table and another linked vacation table... and it always worked perfectly...
 
...wouldn't it be better and easier to create two tables (one for registered fishermen and another for the number of catches) and linking the two tables???
Maybe that's already the case... but we don't know. We here know almost nothing about the structure and grouping. Which is why I'm asking for the element list, because that would tell.

So, let's wait and see the screenshot before throwing more eventually confusing things at the OP?
 
OK 2 screen shots enclosed as I can't fit the whole screen on one - hopefully this is what you want.

Yes I have 2 tables as described and they are linked.

I have looked at editing the elements but I can't find anything in there as a selector for "Group" - can you please point me in the right direction?

Thanks very much both for your input.
 

Attachments

  • screen2.PNG
    screen2.PNG
    280.1 KB · Views: 38
  • screen1.PNG
    screen1.PNG
    265.4 KB · Views: 33
Yup, your screenshots are helpful.
Yes I have 2 tables as described and they are linked.
Nah, apparently all these elements are in the same table "aa_catch_returns".

Anyway, try this:
(1) Create a new group. Name it "Catch Returns Repeatable" or whatever you prefer.
(2) Save & close it, then edit your form for "My Catch Returns". There add the new group to it, then save and close.
(3) Edit the new group and set "Repeatable" to "Yes". You may also already limit the max number of repeats by entering it in "Repeat max", but nothing else = leave the rest as per default. Save and close.
(4) See attached screenshot and the red annotation: edit all these elements and set their group to the new one (see my previous post here above).
(5) Then load your form again. You should now be able to enter multiple catches -- in the same form and, each time, under the same ID, date/time and user.
 

Attachments

  • repeat.jpg
    repeat.jpg
    79.9 KB · Views: 34
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top