Is it possible to insert Typeform form data to my database using server script language like PHP? | Community
Skip to main content
Answered

Is it possible to insert Typeform form data to my database using server script language like PHP?


Forum|alt.badge.img

Hi, i am using embedded code to implement the typeform in my own website page and it’s coming nicely.
But my problem is i don’t know how to insert the form data into my website database.

 

Best answer by Liz

Hi @Kapur Would you be able to use our Responses API

View original

13 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14905 replies
  • Answer
  • April 18, 2023

Hi @Kapur Would you be able to use our Responses API


Forum|alt.badge.img
  • Author
  • Explorer
  • 6 replies
  • April 19, 2023

Thanks @Liz for your quick reply.. As i am new using this Typeform api, so should i need to have the CLIENT_ID, CLIENT_SECRET, ACCESS TOKEN for fetching the response?


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14905 replies
  • April 19, 2023

Hi @Kapur Yes, you will need those. This page here can walk you through how to obtain that information. 😀


Forum|alt.badge.img
  • Author
  • Explorer
  • 6 replies
  • April 20, 2023

Thanks @Liz 🙂


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14905 replies
  • April 21, 2023

Not a problem, @Kapur ! Let me know if you think of any other questions. 


Forum|alt.badge.img
  • Author
  • Explorer
  • 6 replies
  • April 25, 2023

 

Thanks @Liz, sorry for late reply due to work pressure 🙂
I have implemented the Response Api as you suggested to fetch form data to save to my own database. But i have a query, doing this web form implementation i have a requirement to pass a dynamic value from this web form to one of the Typeform fields. I assume that this can be done using hidden field, but somehow i am not able to get this value in Typeform.
Here is my screenshots.

 

Embedded Form
Typeform Field

 


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14905 replies
  • April 26, 2023

Hi @Kapur No worries at all! Do you have the URL where you have the form embedded so we can look at the embed? 


Forum|alt.badge.img
  • Author
  • Explorer
  • 6 replies
  • April 27, 2023

Hi @Liz , thanks for your reply. I have succeeded to get that hidden value in Typeform field. Thanks again. 🙂


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14905 replies
  • April 27, 2023

Glad to hear, @Kapur ! Let us know if you need help with anything else. 😀


Forum|alt.badge.img
  • Author
  • Explorer
  • 6 replies
  • May 1, 2023

Hi @Liz , suddenly i am facing a problem.. as i am implementing the embedded form with response Api call back function. 

<div data-tf-widget="xxxxxxx" data-tf-opacity="100" data-tf-iframe-props="title=Setup Form" data-tf-transitive-search-params data-tf-medium="snippet" data-tf-hidden="affi_email=<?php echo isset($affi_email)?$affi_email:'';?>,affi_fname=<?php echo isset($affi_fname)?$affi_fname:'';?>,affi_lname=<?php echo isset($affi_lname)?$affi_lname:'';?>" style="width:100%;height:500px;"></div>

 

<script src="//embed.typeform.com/next/embed.js"></script>

 

<script>
    function ready({ formId }) {
        console.log(`Form ${formId} is ready`)       
    }
 

 function submit({ formId, responseId }) {
      console.log(`Form ${formId} is ready`)
    }

</script>

 

Suddenly i got no response in my console log when the form is ready, therefore same way i am not able to submit my responses to my server. It was working like champ list week … I couldn’t find out the exact reason for this …

Thanks

 

 

 

 

 


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14905 replies
  • May 1, 2023

@mathio do you happen to know if this is because it’s all being done on the front-end? 


Forum|alt.badge.img
  • Author
  • Explorer
  • 6 replies
  • May 1, 2023

@Liz, i have fixed the issue.. I supposed to copied the newly embedded code after adding two hidden fields in Typeform and this copied section was missing some of form tags.. 

Thanks 🙂


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14905 replies
  • May 2, 2023

Glad to hear it was an easy fix, @Kapur !


Reply