Dynamically transfering Wordpress current_user_id to typeform | Community
Skip to main content
Answered

Dynamically transfering Wordpress current_user_id to typeform


Forum|alt.badge.img

Is there a way in which I can dynamically transfer the Wordpress current_user_id to my embedded typeform ? 

Best answer by mathio-tf

You can pass dynamic variables via JS API if you have the value available client-side. If the value is available server-side you ca just print it into the embed code with eg. PHP.

View original

6 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15018 replies
  • October 5, 2022

Hi @Michel van de Beek Happy Wednesday! The only way to pass information into the form is through hidden fields. Do you have the form embedded on your website? Or how are your respondents are going from your website to the form? 


Forum|alt.badge.img

Hi @Liz the form is embedded on the website. We want to pass the WP current_user_id to the typeform through a hidden field. How do you achieve this?  


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15018 replies
  • October 7, 2022

Ok, thanks, @Michel van de Beek ! This article here can walk you through passing information through hidden fields on an embedded form. 😀


Forum|alt.badge.img

@Liz In the article I don’t see how you can use/transfer dynamical variables. 

Could you help me out with some example code how to do this?


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15018 replies
  • October 10, 2022

Hi @Michel van de Beek This will depend on how you’re grabbing the information from Wordpress. 

@mathio might have some insight on this!


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • Answer
  • October 11, 2022

You can pass dynamic variables via JS API if you have the value available client-side. If the value is available server-side you ca just print it into the embed code with eg. PHP.