Editing Group Elements Save on different db table also?

Tessa

Member
Is there any built in methods on editing a specific Group on a table and all the values saving to a different database table? (As well as the table itself for current values).

I want to be able to show revision history each time the form is edited.

This would prevent me having to create a whole separate table for this group and joining the 2 together, which would mean slower load time (when there is already enough JOIN's going on).


Thanks in advance.
 
Simple answer is "no", not at the moment.

As Jaanus said, you can try the upsert plugin, although that's very new, and probably needs a little work.

We are slowly working on a built in revision system for Fabrik, where all changes are logged, each List has a revision history that can be viewed, and changes to data can be rolled back. It's something a lot of people have asked for, and would be very useful.

But that isn't going to happen for a while, it's still very much in the "proof of concept" stage.

-- hugh
 
Thank you for your advice. I did not know there was a Form Upsert Plugin.

I set up the plugin and it works great. I created a new database table as a "copy" of the table I want copying values to.

Each time I submit the form, it correctly copies a copied row to the new database table.

However, all the values besides the PK show as blank.

Am I suppose to configure this section here for VALUE and DEFAULT? What goes into those fields? I tried {tblbrand___date_time} (value from that main table) but it just inputs that as the data.
Here is the screenshot: K2 China Manufacturing - Administration | Awesome Screenshot

Here is the datatabase table values: K2 China Manufacturing - Administration | Awesome Screenshot


I feel like I may just be missing a little information then it will be working as expected. =)


Thanks in advance! :)
 
In the first screen shot you need to add placeholders which match your form's current data. e.g. {tablename___elementname}
 
Hi Rob, Thank you for the Wiki.

It really helped setting it up correctly and now it works almost flawlessly!

However, I have it set to update on "Both". But when I edit the original form row, it doesn't change in the copied table. Is this suppose to occur?

My purpose of this upsert table is so I can create a hover pop up box using jQuery on a row of all the previous submissions from that row in a new window. :)

Thanks so much! That wiki will definitely help others.
 
To be 100% honest I'm not sure I've tried that.
Before I test can I ask you what setting you had entered for the 'Row value' ?

-Rob
 
Can you try updating from git, and then setting the 'Row value' to :

Code:
{origid}

That should create an upsert record when you create a new record, and then update the same record when editing.

-Rob
 
Can you try updating from git, and then setting the 'Row value' to :

Code:
{origid}

That should create an upsert record when you create a new record, and then update the same record when editing.

-Rob

Works like a charm!

You rock, so does Fabrik!

I don't have to create a new table now and use redundant data now! I can combine all fields into main table and use groups. YAY to faster queries!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top