Viewing 15 replies - 16 through 30 (of 44 total)
  • Thread Starter willbell

    (@willbell)

    One other thing, just to be thorough, I am using “Contact Form 7” and “Contact Form DB”.

    Will

    Hell~ I am late.
    Here is what I want to say detail.
    (I am sorry to say hard to understand.
    I am a Korean, So please understand it. )

    I made 6 steps contact form for patient.
    I just need not all each step data but one combinded record.
    but, there are 7 record.

    1. Result of Performance

    – 1st : combinded data
    – 2~7th : each original data from 1step to 6step.

    2. my coding

    function change_title($formData) {
    if ($formData && in_array($formData->title,
    array(‘Medical Record Check’,
    ‘Medical Record Check 2’,
    ‘Medical Record Check 3’,
    ‘Medical Record Check 4’,
    ‘Medical Record Check 5’,
    ‘Medical Record Check 6’))) {
    $formData->title = ‘Combined Medical Record Forms’;
    }
    return $formData;
    }

    add_filter(‘cfdb_form_data’, ‘change_title’);

    * I want to del 2~7th data, because they are just one persons record.

    Thread Starter willbell

    (@willbell)

    Lim,

    This is the same code as Michael Simpson gave me. Thank you. I have put this in the “Add Actions And Filters” plug-in. I am still not getting combined results from the six DBs. Apparently there is some kind of flaw in my setup, but I don’t know where.

    Thank you,
    Will

    Thread Starter willbell

    (@willbell)

    Michael,

    I just ran a test where I took the load brochure code out of the contact form so I could test to see if that was causing the problem. The Combined Brochure DB still did not appear on the list.

    Thank you,
    Will

    Plugin Author Michael Simpson

    (@msimpson)

    @will

    You might sanity-check your form names (that there are no spaces in them).

    You might add:

    $formData->posted_data['Form Name'] = '"' . $formData->title . '"';

    and do a submission and see what exactly is inside the quotes.

    PS on_sent_ok is irrelevant

    Plugin Author Michael Simpson

    (@msimpson)

    @lim

    I am confused as to whether your are saying that the code does not work or you want to delete certain values that are already in the database.

    Ok, Let me explain detail.

    The code worked and made 6 records in a db ‘combined medical record check’.
    (There are 6 records, firtst line data is a combied data,
    5 records are each step data from 1step to 5th data )

    I just need the first line data which is combined.
    But there created 5 line more.
    I want to delete from 2nd to 6th line or prevent to creat.

    < picture image>

    https://www.miinfra.co.kr:44373/infra/wp-content/uploads/2015/01/db-1024×576.jpg

    -the first line is the combined data from 1step to 6 step.
    -2 line ~ 6th line are record data in each step data

    Thread Starter willbell

    (@willbell)

    Michael,

    No go. I created a no space form name and added it to the code and it still didn’t generate the combined database. This is weird and kind of frustrating.

    I added the code you sent above below the rest of the code but I’m not sure what is supposed to happen with that?

    I have
    Contact Form 7 ver 3.4.2
    Contact Form DB ver 2.6.3
    Worepress ver 3.6.1

    Might these be incompatible?

    Plugin Author Michael Simpson

    (@msimpson)

    Looks like you have a very old version of CFDB. Why don’t you update?

    Thread Starter willbell

    (@willbell)

    BINGO!

    Thank you for your patience!

    Will

    Plugin Author Michael Simpson

    (@msimpson)

    @lim I think I finally beginning to understand.

    Looking at your screen shot, I thing you are using Gravity Forms. Is this a multi-page form? Is it giving you an entry in the database for each page? I thought that Gravity Forms only gave one submission from the last page.

    I’m still confused about how you got several intermediate form submissions and then a final form submission with all the data. But maybe I don’t need to know.

    If you do not want to capture steps 2-6 then I can suggest these options:

    1. Do not use the “change_title” code. Remove it. Go to the CFDB Options page. Find the option for names of forms that you do not want to save. Put in “Medical Record Check 2,Medical Record Check 3,Medical Record Check 4,Medical Record Check 5,Medical Record Check 6”. Then only “Medical Record Check” will be saved in the database.

    2. If for some reason you need to use the code, know that if you use “return null;” instead of “return $formData” in the function, then no data will be saved. You could add logic in the function to have a form save or not based on which value it returns.

    I hope this helps.

    Thank you for your kindness, Michael Simpson

    1) I used ‘Contact Form 7 Multi-Step Forms’ plugin

    2) ‘function change_title($formData) ‘ is used for combinding ‘medical record steps(from 1 to 6 level)
    because ‘Contact Form 7 Multi-Step Forms’ don’t creat combing form data, but
    creat seperated form data.

    3) process

    – I did what you said ” delete ‘function change_title($formdata)'” , and set do not want to save form which is
    ‘Medical Record Check 2,Medical Record Check 3,Medical Record Check 4,Medical Record Check 5,Medical Record Check 6’

    4) result

    – combined data has gone, and each form datas created.

    5) P.S

    – I tried to set ‘do not want to save form’ without deleting ‘function change_title($formData) but 1~5 form record created also.

    6) picture ( for the result)

    – created step data

    https://www.miinfra.co.kr:44373/infra/wp-content/uploads/2015/01/medical-record-check-frame-data-1024×440.jpg

    – created step frame detail data

    https://www.miinfra.co.kr:44373/infra/wp-content/uploads/2015/01/inner-record-1024×440.jpg

    Thread Starter willbell

    (@willbell)

    Michael,
    Just wanted to let you know that my issues are resolved. Your coding was right on, it was the update of DFDB that was holding up progress.
    I have not marked this as resolved since you have Lim’s question still ongoing.
    Thank you,
    Will

    Thread Starter willbell

    (@willbell)

    Michael,

    I lied. I have one more question.

    Let’s say I have three databases and one combined database consisting of data from the three.

    I am looking at the combined database and I see and entry and I need to know which of the three forms that entry comes from. How do I create a column that shows which contact form the entry came from, ie. which of the three databases the entry on the combined database comes from.

    Thank you,
    Will

    Plugin Author Michael Simpson

    (@msimpson)

    @lim

    I’m sorry but I don’t know how to solve this problem. CFDB was not coded without taking into account ‘Contact Form 7 Multi-Step Forms’ plugin.

Viewing 15 replies - 16 through 30 (of 44 total)
  • The topic ‘Multiple forms submit to one database’ is closed to new replies.