Importing partial data from two forms into a different form

Status
Not open for further replies.

degarrin

Member
I am looking for some suggestions on the best way to handle an issue I've had come up with a form. We have two separate forms that need to be merged into one new, improved form. The new form will include some of the fields from the original forms, but not all of them, and will also have new fields added as well. Is there an easy way to get the data from the original forms into the new form without having to just re-enter it all? Would a database join or CSV import do the trick or would the fact that I only need certain fields cause a problem? Or am I going to have to do something more complex via the database? I am a noob when it comes to those features, so I'm not sure what to try without messing up the tables.

Thanks!
Angela
 
the answer depends a bit on what the data it is that you have in the two tables, ie is there a common value that links record X in table A to record Y in table B?

Could you post a description of the two tables?


thx
Rob
 
The two "old" tables are fab_heal_session and fab_heal_screen. We are a church and offer certain wellness services to our members. The two forms work in tandem, so there is actually a lot of duplication of information. I have already created the new form, with the table fab_healings, however, no big deal if that doesn't work and I need to do something else or start from scratch. Each form has several different groups, but they all have a "General" group. I included screenshots of the "General" group of each form so you could see the elements I have set up in each, because that is where the most duplication exists.

Does that answer what you needed? If not, let me know.

Thanks!
Angela
 

Attachments

  • Healing Session Form.JPG
    Healing Session Form.JPG
    69.6 KB · Views: 158
  • Healing Screening Form.JPG
    Healing Screening Form.JPG
    58.9 KB · Views: 182
  • Healing Form - New.JPG
    Healing Form - New.JPG
    82.4 KB · Views: 181
OK, first question is, are JUST asking about creating a new Fabrik list/form, which includes (most) of the elements from the existing separate forms. Or ... are you ALSO asking about merging your existing data from the three separate form, into row data for the new, "combined" form?

What Rob is asking assumes that you want to merge existing data. And the problem there is finding some piece, or combination of pieces, of data which is common AND UNIQUE for each pair of rows you want to merge from the old table. So for each row in each table, we can work out which rows "belong" to each other.

Only you can tell us what you think might be the unique indexing we can use to try and match rows.

Then, the approach I would take, would be to create a MySQL View, which selects the fields you want from the two (or three, or whatever) old tables, using whatever criteria we can come up with joining (associating) the rows together. Then export that View as a CSV.

The problem is, from looking at your data structure, I think it's going to be very hard to match the rows between the old tables, deifning with any certainty which row from table B "belongs" to which row in table A.

-- hugh
 
Yes, I want to merge some of the data from Table A (fab_heal_session) and Table B (fab_heal_screen) into Table C (fab_healings).

Okay, the unique indexing. Based on what I've been reading, my understanding is that means that no two rows can ever have the exact same information, correct? I don't really have any fields in these forms like that, unfortunately; even the user can have multiple entries with these particular forms. The only unique index would also be the primary key (fab_healings_id, fab_heal_screen_id, fab_heal_session_id) for each form.

Now, you were right of course that there really wasn't any way to match the rows on Table A and Table B. However, there really aren't too many records in the forms, so after backing up my tables and some nail-biting finagling this week, I have managed to change the id field of each row in the fab_heal_session table to match that of the fab_heal_screen table. Will that be enough to give us what we need to pull the data? Sorry I am still so new to this, I really appreciate your time on this.....
 
Status
Not open for further replies.
Back
Top