como posso fazer o jotform consultar meu banco de dados SQL para preencher um formulário

  • praticaservicos
    Perguntado em 11 de julho de 2023 às 13:53

    esta consulta precisará ser feita varias vezes altomaticamente

  • Mafe_M Jotform Support
    Respondido em 11 de julho de 2023 às 19:49

    Hi Alex,

    Thank you for reaching out to Jotform Support. I'm using a translation tool to provide support for you in a timely manner, but if you prefer to get help in Portuguese, we can forward you to our Portuguese Support team. However, keep in mind that it may take longer to receive a response. 

    Now let me help you with your question. To my understanding, you want to store form data in my database MySQL, is that right? If yes, then you can get your form data by allowing your form to send the post data to your Thank you page. Let me show you how to do it:

    • In Form Builder on the orange navigation bar, click on Settings.
    • Go to the Form Settings tab on the right-hand of the page.
    • Click Show More Options.

    como posso fazer o jotform consultar meu banco de dados SQL para preencher um formulário Image 1 Screenshot 40

    • Scroll down to SEND POST DATA section and choose Enable from the drop-down.

    como posso fazer o jotform consultar meu banco de dados SQL para preencher um formulário Image 2 Screenshot 51

    And if you want to get your post data variables along with pre-formatted PHP codes. Let me show you how to set it up:

    • In Form Builder on the orange navigation bar, click on Settings.
    • Go to the Thank You Page on the left-hand of the page.
    • Select Redirect to External Link.
    • Then paste the following URL: https://www.jotform.com/show-post-data/

    como posso fazer o jotform consultar meu banco de dados SQL para preencher um formulário Image 3 Screenshot 62

    Save your form and make a test submission. You should be able to see post data variables on your form thank you page along with the preformatted PHP codes. Once you get all the data, you can now send them to your Mysql database. Please refer to this guide.

    Let us know if this works for you.


  • praticaservicos
    Respondido em 12 de julho de 2023 às 07:35

    Olá, creio que não fui específico.

    Deixe-me reformular a pergunta.

    Estou criando um formulário que, quando for preenche-lo, ao digitar o número de matricula do cliente, o jotform consulte o numero da matricula no meu banco de dados MyQSL e preencha automaticamente o restante do formulário com dados consultados no banco.

    este banco de dados é atualizado varias vezes no dia.

  • Karlo Jotform Support
    Respondido em 12 de julho de 2023 às 09:49

    Hi Alex,

    Thanks for reaching out to Jotform Support. I’ll need a bit of time to look into this. I’ll get back to you as soon as I can.

    Thanks for your patience and understanding, we appreciate it.

  • Karlo Jotform Support
    Respondido em 12 de julho de 2023 às 10:31

    Hi Alex,

    Thanks for patiently waiting. To clarify, do you want your data to fill out a form automatically? If so, we have our spreadsheet to form a widget. This widget allows you to upload the spreadsheet to your form to prepopulate the field on your form by using a unique code. Let me show you how.

    1. In Form Builder, on the left side of the screen, click on Add Form Element.
    2. Go to Widgets, search for Spreadsheet to Form, and click on it.
    3. Click on the Wand Icon on the Field.
    4. On Spreadsheets, click on Upload File and select the file with the data.
    5. Scroll down and click on Update Widget.

    como posso fazer o jotform consultar meu banco de dados SQL para preencher um formulário Image 1 Screenshot 30

    You could also use the forms source code and you can make your own script to get the data and populate to your form.

    1. In Form Builder, On the orange navigational bar, click on Publish.
    2. Go to Embed and click on Source Code.
    3. You can Copy Code or Download Source Code.

    como posso fazer o jotform consultar meu banco de dados SQL para preencher um formulário Image 2 Screenshot 41

    Take note that when you make changes to your form, you have to copy the source code again and update it manually on your website because the form's source code does not update automatically. Here are guides on How to Use the Spreadsheet to Form Widget and How to Get the Full Source Code of your Form.

    Let us know if there’s anything else we can help you with.

  • praticaservicos
    Respondido em 12 de julho de 2023 às 12:59
    It's hard to get a concrete answer from the jotform.
    I need to query a database to fill in the form, not a spreadsheet.


  • Mafe_M Jotform Support
    Respondido em 12 de julho de 2023 às 13:41

    Hi Alex,

    Thanks for getting back to us.  Unfortunately, you cannot pull data from your database to your form. As a workaround, you can query the necessary data from your database and export them to an Excel/CSV file. After that, upload the file to a Spreadsheet To Form widget added to the form as what is suggested by a colleague in our previous response. This works like a database query tool, but instead, it uses the Excel file that you uploaded. 

    Now on your form, you can set up a conditional logic using the Spreadsheet To Form widget. For instance, your unique identifier is an email address, once the form respondent fills in an email address it will be passed to the Spreadsheet To Form widget.

    The Spreadsheet To Form widget will now then pull up the record of that customer, from here you can set up a calculation/condition on how you would like to do with the payment process.

    Let us know if there’s anything else we can help you with. 

  • praticaservicos
    Respondido em 12 de julho de 2023 às 15:07
    the problem is that this spreadsheet that I will upload to the platform is updated every 30 minutes, I can't keep updating it manually, I hope I'm paying for a platform that has a simple tool.
    I await the solution!


  • Ryan Jotform Support
    Respondido em 12 de julho de 2023 às 17:53

    Hi Alex,

    Thanks for getting back to us. Unfortunately, this is how the Spreadsheet to Form Widget works as the spreadsheet file needs to be updated in order to fill the form with the updated data.

    Another workaround is to prepopulate the form fields using URL parameters. We have a guide about Prepopulating Form Fields via URL Parameters that you can check out. You can prepopulate the form by fetching the data in your database and redirecting the user to a prepopulated form URL.

    Reach out again if you have any other questions.