Calling external API from jot form and rendering the result in another form

  • rebeirostacey
    Asked on August 25, 2019 at 4:57 AM

    Hi,

    I have the below requirement

    Form 1 will be a Jotform which collects some data .

    On submit I want to invoke an external REST API (which in turn will fetch data from say mysql db) .

    The result of the api want to use to render on JOT form 2

    Could you explain how to achieve the same 


    Regards,

    Stacey

  • jherwin
    Replied on August 25, 2019 at 5:55 AM

    To clarify, would you like to get the data entered in the first form then pass it in the second once the first form is submitted? If so, you can refer to the guide below.

    Guide: Prepopulating-Fields-to-Your-JotForm-via-URL-Parameters

    Let us know if you are referring to something else.

  • rebeirostacey
    Replied on August 25, 2019 at 6:20 AM

    Hi,

    I don't need the data from form 1 to be directly passed to form 2 .

    What I need is as follows,In form 1 for example the user enters the license number of his organization .Now using the license number I need to invoke an external api which gets the data of the entire license like the licence owner ,the issuing authority ,address ,business etc and use it in the second form . The second form will have then these fields prepopulated and in addition user will fill some additional information and finally submit the form


    Thus we can capture the entire information of the user ,some by user input and some by making external api call's

  • Victoria_K
    Replied on August 25, 2019 at 7:35 AM

    As far as I understand, the purpose of an external API call would be to populate form based on the data entered to field. I'm afraid, external API calls will not be supported, but we have a widget, which I suggest you to review. It can populate form from attached excel file: How-to-Use-the-Spreadsheet-to-Form-Widget

  • rebeirostacey
    Replied on August 25, 2019 at 7:44 AM

    Spreadsheets as mentioned will become slow as the data it holds increases .

    I know you can invoke an external form on submit event like a php page or a jsp page(webhooks ?) ,so from the say jsp page i could invoke an external api and take the results ,cant i redirect it back to another jotform and pass in the query string all the data needed for form 2 which i got back from the api call ?


  • Victoria_K
    Replied on August 25, 2019 at 8:17 AM

    Yes, we provide webhooks feature and also forms can POST data to external web page. But, setting up webhooks and capturing POSTed data should be handled from your end.

    Here are related links: 

    How-to-Setup-a-Webhook-with-JotForm

    How-to-Post-Submission-Data-to-Thank-You-Page

    This way, redirection to another JotForm form will also need to be a part of your custom script.