PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Importing Data thru MySQL

  1. gwc_wd
    Member

    I understand the Import function of GF is for the form settings and not the entries.

    I have an existing form. I have a set of data that matches the fields in the form.

    My plan was to simply do an import through PHP admin. In preparation, I exported the existing data from the MySQL table rg_lead_table to see what fields existed.

    But the field IDs do not appear to be consistent. They're not actually called "id" but "Field Number." Some look to be the same number from record to record but others do not.

    Is this the way it is supposed to work or are the inconsistent field numbers an artifact of form editing or something else?

    Basically, can I take a set of field numbers, use them in building an importable data file and produce functional results?

    Or must every record really be manually keyed regardless?

    Thanks for any tips or other methods of getting bulk records into the GF tables.

    Posted 13 years ago on Sunday January 16, 2011 | Permalink
  2. If you are trying to move entries from one Gravity Form to another, try the following:

    1- Create your new forms and make note of the field Ids (yes, they correspond to the field_number column in the wp_rg_lead_detail table)
    2- Update the form_id column of the wp_rg_lead table and wp_rg_lead_detail table from your original form to the new one.
    3- Update the field_number column of the wp_rg_lead_detail table to match your new field Ids

    Posted 13 years ago on Tuesday January 18, 2011 | Permalink
  3. gwc_wd
    Member

    Thank you for that help.

    I am not trying to move data from one GF form to another. I am trying to get external data into the GF table. Some field numbers, for example holding the First Name, show as 2.3 but in one record the same First Name data shows as some other number, say 16.

    The field numbers are *almost* consistent, but not entirely and the variations show no pattern that I can decipher.

    This has to be something to do with how GF creates fields in the data tables which might include the creation of inconsistent field numbers due to editing or some other action the user (me) is doing.

    Understand this is not a complaint about GF. It is the best form tool and much more than a form tool. I love the damn thing.

    But I am still going to try to find ways to do things that I specifically need done and that may not be useful to the greater audience GF has to serve.

    Part of what makes GF magical is that it allows manipulation of the data with external tools (SQL queries). My intention was to have the relevant data consolidated so that I could generate reports from that single source.

    I ended up simply accepting that there is no way to add the data to my GF entries and instead imported the data set as Posts using a csv import. Over some time the problem will solve itself as the old posts are replaced by GF form entries. In the mean time I will maintain two data sets, one in the GF tables and one local that is basically the Posts table.

    I do appreciate you thinking about this topic for me.

    .glenn.

    Posted 13 years ago on Wednesday January 19, 2011 | Permalink