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.

Best method to extract data from multiple forms

  1. BruceMcK
    Member

    I am using the Paypal add-on, and my site sells these two items:

    1 - A competition entry fee
    2 - A competition shirt

    I have three forms, which do the following:

    A - Pay the entry fee and optionally buy a shirt
    B - Buy a shirt only
    C - Does the same as form A, but non-Paypal (e.g., a manual bank deposit; purchaser provides the detail via the web site, and an admin manually updates the entry when the bank deposit is made).

    What I need to do is to provide the following reports:

    * - List of people who paid the entry fee (via both forms A and C)
    * - List of people who purchased a shirt (via forms A, B and C)

    The standard export isn't an option in this case; these reports are pretty specific, and need to be available on demand.

    I've looked through the database, and have worked out the mapping of the form data in the wp_rg_lead_detail table. The SQL statements are going to horrible.

    My question is this, what would you recommend as the best way of extracting this data out of the GF tables? I'll probably implement the export as a plugin with an admin panel. Is there a function with GF that can help me get the data I'm after quicker than just using SQL.

    Cheers, and thanks for the great product.

    Posted 10 years ago on Saturday January 8, 2011 | Permalink
  2. BruceMcK
    Member

    Just had a thought. Another method might be to write a plugin to hook gform_post_submission and write the relevant data out to two custom db tables. That way I can organise the information to make my reporting easier.

    Put will the Paypal payment be complete when gform_post_submission is called? What if the IPN is less than instant?

    Posted 10 years ago on Saturday January 8, 2011 | Permalink
  3. There aren't going to be any helper functions for what you want to do as there is no functionality currently that combines data from separate forms in Gravity Forms. You would have to write the SQL yourself.

    Or you would have to export the entries to CSV and then combines those CSV files some how using custom code or Microsoft Excel, etc.

    When using the PayPal Add-On there are other hooks you can use to execute code after payment is received. These will be documented with the final release. The hook you can use that is fired only after PayPal IPN says payment has been received is:

    gform_paypal_fulfillment

    There is another hook if using PayPal subscriptions that is used when a subscription is canceled:

    gform_subscription_canceled

    Posted 10 years ago on Sunday January 9, 2011 | Permalink
  4. BruceMcK
    Member

    Thanks Carl. I'll give those hooks a look.

    Cheers, Bruce.

    Posted 10 years ago on Sunday January 9, 2011 | Permalink