Preselect answer for embeded typeform | Community
Skip to main content
Answered

Preselect answer for embeded typeform


Hi Community,

I can’t find an answer for the following setup, maybe it is not a supported feature but maybe someone found a solution.


We want to use the preselect answer feature for an embedded typeform.
Dynamically passing hidden fields is already set up with this form.


question: Is there a way to preselect an answer for an embeded form via url?

Thanks in Advance

Best answer by mathio-tf

Unfortunately embed lib does not support this out of the box. But we always welcome pull requests with new features :) https://github.com/Typeform/embed

As a workaround you could build your typeform URL with pre-filled answer (just like in the docs) based on the URL of your own page. Then you can use this URL in place of the form ID, eg. as value of data-tf-widget attribute or as first argument of the createWidget method.

View original

7 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15025 replies
  • August 31, 2022

Hi @jostjul I believe @mathio answered this in another post, but I can’t find it for the life of me. He might have an idea where he answered it!


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • September 1, 2022

Hi @Liz  I dont think we have covered such an advanced solution yet. 

Hello @jostjul I’d like to confirm what is your use case. You want to preselect an answer of embedded typeform via URL of your host page, correct?


  • Author
  • Explorer
  • 2 replies
  • September 1, 2022

Hi @mathio, thanks for getting in touch.

Yes, we want to use the “start from email” logic but with an embeded form.

I understand, that in non mebeded forms you can preselect answers through URL ankers

#answers-<question-reference>=<answer-reference>

I was wondering, if embed feature supports such anker or other URL syntax to preselect an answer.


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

Unfortunately embed lib does not support this out of the box. But we always welcome pull requests with new features :) https://github.com/Typeform/embed

As a workaround you could build your typeform URL with pre-filled answer (just like in the docs) based on the URL of your own page. Then you can use this URL in place of the form ID, eg. as value of data-tf-widget attribute or as first argument of the createWidget method.


  • Author
  • Explorer
  • 2 replies
  • September 7, 2022

@mathio thanks for the reply and support. might be a notch too complicated workaround for us. Maybe @Liz can check if function qualifies as feature request for the roadmap.


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15025 replies
  • September 8, 2022

Hi @jostjul I can certainly share this with the product team! Though, I can’t make any guarantees they would add this to their roadmap. 


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • September 8, 2022

Embed SDK is an open source library, anyone can contribute 🙃