populate dropdown list according to submissions from another form

  • chinathinksbig
    Asked on November 5, 2015 at 12:34 AM

    Hi I'm trying to find a way to populate a dropdown list of a field in a form, according to the submission of another form.

    I need the two forms for a competition, now in its application phase. We receive their applications and give feedback to each individual applicant about whether their thesis is approved.

    So my first form is an application form for applicants to fill in their name, email, contact detail, thesis description and so on. Here is the link for the first form: https://form.jotform.com/52991208615964

     

    The second form is for the graders. I want the submitted names in the first form to become the options of a drop-down field in the second form, and preferably display their matched email address and thesis descriptions(a fixed value when a name is selected).

    Ideally, in the second form, I want the graders to choose the name of an applicant from the drop-down list, read their thesis descriptions. Then they choose whether the thesis is approved or not, if not approved, a conditional textbox will pop up to write suggestions. When the graders submit the second form, an autoresponder email will be sent out to the applicants according to the email address provided, telling them if their idea is approved.

     

    Is this function available at all? If not, is there any other way to achieve what I want? There is simply too many submission to do them manually. I don't mind if the process is complicated, as long as it gets the job done.

    Huge thanks,

    Mu

  • Sammy
    Replied on November 5, 2015 at 5:49 AM

    At the moment it is not possible for a form to read data from another form.

    To achieve this we will need the first form to submit the data to a MySQL database on your site so that we can be able to pick the data and use it in the second form. Here is how the workflow will go.

     

    Step 1 : Send data from first form to a custom PHP page which will then insert this data to a database

    http://www.jotform.com/help/213-Send-POST-Data-From-JotForm-Using-PHP-in-Custom-Thank-You-Page

    Step 2 : Embed the second form to your site(same domain hosting you database) using the full source code method, this will allow us to pick data from the database and populate the relevant fields with the initially submitted information.

    populate dropdown list according to submissions from another form Image 1 Screenshot 30

    populate dropdown list according to submissions from another form Image 2 Screenshot 41

    Let us know if the above workflow is satisfactory for you and if you will need additional guidance and steps on how to accomplish this, we will be happy to assist.

  • chinathinksbig
    Replied on November 5, 2015 at 8:14 AM

    I'm working on the PHP code, thanks.

    I still got a question here, does this method mean that when I submit the first form, the page will be redirected to the second form with submitted data prepopulated on it? What should I do to send the access of the second form to the the third person, in stead of being seen by the fillers of the first form?

    I wonder if I'd made myself clear:)

    Thanks for you help!

  • chinathinksbig
    Replied on November 5, 2015 at 8:28 AM

    And, has this tutorial anything to do with my case?

    http://www.jotform.com/help/126-How-to-send-Submissions-to-Your-MySQL-Database-Using-PHP

  • mert JotForm UI Developer
    Replied on November 5, 2015 at 9:59 AM

    Hi there,

    Yes, the tutorial which provided by Sammy will prepopulate the values from one form to another webpage or form.

    The only thing for you to do is sending the first form's URL, because when the first one is submitted, it redirects the user to the second form automatically.

     

     To do that, you just need to follow the guide from the below:

    http://www.jotform.com/help/213-Send-POST-Data-From-JotForm-Using-PHP-in-Custom-Thank-You-Page

     

    For instance, Red marked area is the URL of the second form which is going to get the data from the first form. On the green marked area, "var3" which is the variable from the second form takes the value from the "email4" which is coming from the first form. So, you can think this scenario for your dropdowns.

     

     $answers = $_POST;

     $url1 = "http://jotformpro.com/form/23503595638965"; // This is the URL address of the Form

     

     $var1 = "?fullName3[first]=".urlencode($answers[fullname3][0]);

     $var2 = "&fullName3[last]=".urlencode($answers[fullname3][1]);

     $var3 = "&email4=".urlencode($answers[email4]);

     $var4 = "&comments=".urldecode($answers[comments]);

     $url2 = $url1.$var1.$var2.$var3.$var4;

     header("location:$url2");

    ?>

     

    I hope this explanations will help you. For further assistance, please let us know.

    Thanks.

  • chinathinksbig
    Replied on November 5, 2015 at 11:18 AM

    That is very helpful! Thank you!

    Few more questions, sorry I'm new to PHP settings so please bear with me

    1. How do I prevent people who fill the first form to see the second form? 

    2. My understanding for this method is, every new submission to form1 will generate a new link to a new link to form2 with prepopulated data. If so, is there a way I can automatically capture these links and match them with form1's submission names? I want to realise this because I need to send graders the submissions in bulk.

    If my understanding about this method was wrong please correct me.

    Thanks!

  • Sammy
    Replied on November 5, 2015 at 12:54 PM

    From you first thread post you want the submitted names of the applicants to appear in the drop-down of the second form and also the applicant to not view the second form upon submission.

    You might consider saving the submitted data to your MySQL database on your server as described in the link you had earlier mentioned

    http://www.jotform.com/help/126-How-to-send-Submissions-to-Your-MySQL-Database-Using-PHP

     

    Once the data is saved into you database, here is what we will do to the second form.

    1. Ensure it has a drop-down for holding the names of the applicants

    2. Section for showing the thesis (if it was a typed submissions and not a file upload)

    You will then embed you second form using the full source code method, reason for this is we want to expose the drop-down to the MySQL server so that we can fetch the applicant names via ajax dynamically and only have the grader look for the names and submit their outcome.

     

    This approach will take a bit of sometime but once its implemented, you will only need to update the following.

    1. The second form's embedded source code if you've made and changes in the form builder

     

    I can guide you on how to achieve this once you have the database set up on your end for holding the applicants info.