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.

Fields from one form to another with a queue inbetween?

  1. I’ve tried multiple Gravity Form hooks and filters to solve my issue.. to no avail.

    Background: I’m creating a website for a client that utilizes several gravity forms:
    Logically, the steps flow like this:

    1) The user (subscriber) fills out Form 1 and submits information to the website.

    2) This information goes into a queue (a row on Table 1), waiting for my client (admin) to view the next time he logs into the website.

    3) Once my client views the information (Table 1), he clicks a link (corresponding to the appropriate row in the Table 1 queue) to Form 2 where he can add additional information that is then combined with the original information into one form.

    4) Once this final form is submitted, the subscriber gets an email notification, a PDF is created, etc.

    My issue is combining the subscriber Form 1 submitted information with the admin’s additional added information on Form 2. My strategy so far to get the submitted info from Form 1 into Form 2, is to use the Form 1 form_id and entry_id to look up the right entry to dynamically populate part of Form 2 (the other part is input by my client). I can dynamically populate fields in Form 2 with standard PHP variables or php strings using add_action and filters in my Theme’s function.php file, but I can’t figure out how to get Form 1 specific entry details to dynamically populate.

    For instance, Form 1 has name, email, and phone fields. How do I get those fields to dynamically populate in Form 2 when Form 1 doesn’t submit to Form 2?

    If Form 1 submitted directly to Form 2 it’s no problem – use the standard dynamic population options.. but in my case, Form 1 submits, then I have a queue (Table 1) where my Client can view all the Form 1 entries, then need to populate some fields in Form 2 where my client can fill in more fields and submit all this info combined in one form.

    Can someone offer some advice?

    Thanks!

    Posted 11 years ago on Friday December 21, 2012 | Permalink
  2. Anyone have any thoughts on this?

    Posted 11 years ago on Friday December 21, 2012 | Permalink
  3. David Peralty

    To do this, you would have to custom code the SQL queries to pull the data and use gform_pre_render to push the received data into the form fields on form 2.

    http://www.gravityhelp.com/documentation/page/Gform_pre_render

    Posted 11 years ago on Friday December 21, 2012 | Permalink
  4. Thanks David. I'll investigate.

    So I'd need to do the custom MySQL queries in my theme's functions.php file where I do the pre-rendering?

    Posted 11 years ago on Friday December 21, 2012 | Permalink
  5. The SQL to get the information and populating the form with gform_pre_render will all be done in your theme's functions.php. All the functions can be hooked to the gform_pre_render hook.

    Posted 11 years ago on Friday December 21, 2012 | Permalink
  6. David,

    Still having trouble. I can hard code the form_id into my functions that does the MySQL queries, but how do I pass the proper lead_id information back to this function in my functions.php file?

    Posted 11 years ago on Friday December 21, 2012 | Permalink
  7. In order to get the right info out of the form 1 entry with the MySQL lookup, how can I access the lead['id'] and the $lead{'form_id'} in my functions.php file?

    Posted 11 years ago on Monday December 24, 2012 | Permalink