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.

Database storage order

  1. tdiaz
    Member

    Is it possible to store the form data all in a single record instead of each line item on it's own record?

    Key, First, Last, Address, City, ..
    1, Fred, Flintstone, 2020 Rocky Way, Bedrock ..

    Instead of the way it (appears to do it)
    Key, ID, item, content
    1, 1, first, Fred
    2, 1, last, Flintstone
    3, 1, address, 2020 Rocky Way
    4, 1, city, Bedrock

    The former is a whole lot easier to work with other database front ends, to move data in and out, etc.

    Posted 14 years ago on Thursday March 18, 2010 | Permalink
  2. tdiaz
    Member

    Is this a hard question?

    Posted 14 years ago on Tuesday March 30, 2010 | Permalink
  3. The data structure for Gravity Forms is not configurable. You can use available API hooks to store the data wherever you want when a form is submitted, but that requires custom PHP and there isn't a built in point-and-click configuration tool for doing this. You would have to do it with custom PHP.

    Posted 14 years ago on Tuesday March 30, 2010 | Permalink
  4. tdiaz
    Member

    Okay, so it's not configurable. But, am I correct in how it does it now?

    In which case, thats a deal killer outright for me, almost better to store it in a flat csv file, at least a whole row is a single record unlike this where it's a record for each entry.

    The idea here is to access the form data on the back end with something like FileMaker, using the mysql database as the storage point. This method of data storage sounds nuts. Maybe I'm wrong, but I've never ever seen form data stored across records.

    Posted 14 years ago on Tuesday March 30, 2010 | Permalink
  5. Forms are 100% configurable by the end user. Because of that the form entry data is stored at as an array in a single row to account for the fact that no 2 forms could be a like.

    The ideal situation is a column for each field, however that then means each form needs it's own table and database tables would be added, modified and deleted on the fly as you create and edit forms. This poses technical hurdles and support issues that would have to be tackled because things would be much more complex.

    Because of the fact the forms are configurable and each one is unique the data is stored in a consistent format, in the same tables, as an array. The plugin then knows how to display and work with this data format.

    Gravity Forms is a form builder and form submission tool, it isn't designed to be a database data capture tool. It's primary focus is contact forms and user submitted post creation.

    The data can be exported as CSV and our export tool code could be reproduced to do this on the fly if you wanted to write custom code that could be pulled from a 3rd party application.

    Or the other option is using an API hook and custom PHP to do whatever you want with the data when the form is submitted.

    Posted 14 years ago on Tuesday March 30, 2010 | Permalink
  6. tdiaz
    Member

    Hmmm... okay, you raise a valid point. It's a lot easier to add a row before a column with regards to being dynamic and flexible.

    Now on the other angle, yes, Gravity Forms is a form builder and submission tool, and since most of the time data is collected for another use .. Yes, the collection would like nice and be easy to generate, it still means we have to work with the data in some other way.

    Perhaps a "converter" can be crafted to push the input data over to another database and then drop it from where it was put originally by the plugin.

    Posted 14 years ago on Thursday April 1, 2010 | Permalink
  7. Of course, anything is possible. Our Add-Ons for MailChimp, Campaign Monitor and FreshBooks basically do exactly that only instead of pushing data from a form to another database they push it to these 3rd party services via their API.

    So it's entirely possible to create an Add-On that would allow you to map fields on a form to columns in another database and then push that data to that database when a form is submitted.

    It could be done by reverse engineering one of our add-ons and then customize it to do whatever you want.

    Posted 14 years ago on Thursday April 1, 2010 | Permalink
  8. We're looking to do something similar, except in a "batch" mode. So the user would log in to FileMaker and click a button, which would run a script to:

    - export all the new (unread) entries from Gravity Forms since the last time the script was run
    - mark all of those entries as "read" inside GF
    - import all the entries into FM

    This is a little different than the way the GF Add-ons work, since we're not exporting the data when the form is submitted -- instead, we're exporting only when the user requests it

    Are you guys aware of any GF hooks we should be using to do this? Or perhaps any scripts that are already created that are similar?

    Posted 12 years ago on Sunday September 25, 2011 | Permalink
  9. I'm not aware of any scripts that are already created that do this. Hook wise there are no export related hooks. You'd have to duplicate the existing export code and use that as a base to write your own custom export functionality.

    Posted 12 years ago on Monday September 26, 2011 | Permalink