Thanks @alexs,
This will be helpful, indeed
Thanks @alexs,
This will be helpful, indeed
Hey guys, still having issues with this! Hope someone can help?
Steps I took:
[Screenshot 1 in attachment]
[Screenshot 2 in attachment]
[Screenshot 3 in attachment]
Note: I also tried @alexs approach but didnāt have luck there neither. Hope someone can help!
Cheers
@Luay can you pls share where exactly this code is being added ?
Hi @artur this code is being into Pages > Pages Settings > Custom Code > āCode inside headerā:
And I am adding the Typeform embed code into the ācustom code blockā itself (as per screenshot 3 in the first attachment above).
Thanks
@Luay the code you shared needs to go into custom code block and not page settings. Pls try putting this into custom code block.
Hi @artur , ok thanks. I have instead placed the code all into the Custom code block itself. Typeform appears all ok: it shows up on the published app and captures the info fine. However, still not able to collect the hidden āemailā in the results on Typeform.
The code is as follows;
<div class="w-100 text-center"><p class="h6"><div data-tf-widget="RmcFJGeZ" data-tf-opacity="100" data-tf-iframe-props="title=My typeform" style="width:100%;height:500px;"></div>
<script src="https://embed.typeform.com/next/embed.js"></script>
<link rel="stylesheet" href="https://embed.typeform.com/next/css/popup.css" />
<script>
(function() {
let typeformId = 'RmcFJGeZ';
let emailData = 'email';
if(window['logged_in_user'] && window['logged_in_user']['softr_user_email']) {
emailData = window['logged_in_user']['softr_user_email'];
}
const intervalId = setInterval(() => {
if(window.tf == undefined || !window.tf.createPopup) {
return;
}
clearInterval(intervalId);
document.querySelector('#' + typeformId).onclick = function() {
window.tf.createPopup(typeformId, {hidden: { email: emailData }}).open();
}
}, 100);
})();
</script>
Thank @artur
Pls DM a link with details so I can login and check
Hi @artur managed to get it working ok! Your original code worked just fine after all. Went in circles to start with but got there in the end. Thankss
HI @Luay & @artur can i ask how you did it? i have copy & pasted (in custom code block) the same code but the hidden fields donāt show up on typeform.
Thanks in advance!
<div class="w-100 text-center"><p class="h6"><div data-tf-widget="xx3RzThu" data-tf-opacity="100" data-tf-iframe-props="title=My typeform" style="width:100%;height:500px;"></div>
<script src="https://embed.typeform.com/next/embed.js"></script>
<link rel="stylesheet" href="https://embed.typeform.com/next/css/popup.css" />
<script>
(function() {
let typeformId = 'xx3RzThu';
let emailData = 'email';
if(window['logged_in_user'] && window['logged_in_user']['softr_user_email']) {
emailData = window['logged_in_user']['softr_user_email'];
}
const intervalId = setInterval(() => {
if(window.tf == undefined || !window.tf.createPopup) {
return;
}
clearInterval(intervalId);
document.querySelector('#' + typeformId).onclick = function() {
window.tf.createPopup(typeformId, {hidden: { email: emailData }}).open();
}
}, 100);
})();
</script>
Hey @P.Kunert some questions to help you troubleshoot: Are your users signed up and signed in? i.e Are you collecting the email and name start with? Do the field titles match?
Great! What was the issue afterall?
@Luay
I suggested to add the corresponding typeformId to the script, as well as to add the āemailā and ānameā hidden fields to the Typeform. Thus the issue is fixed
@artur @Viktoria Here is what iām using, but itās not working. Trying to get softr to send typeform the email info. Any ideas?
@P.Kunert What did you end up doing to make this work?
Instead of XXXXX add your TypeForm widget ID . You can see the widget when you get the embed code for your TypeForm.
You donāt need to copy and paste your TypeForm embed code. You simply need to add the ID to the code below.
Please make sure you have added hidden fields to your TypeForm to get the userās emails and names. Here is a tutorial on a Hidden field - https://www.typeform.com/help/a/using-hidden-fields-360052676612/
Add the code below to the Custom Code block in Softr. Make sure you save and publish the app and it should work.
<script> let typeformUrl = 'https://form.typeform.com/to/XXXXX?typeform-medium=embed-snippet#'; if(window['logged_in_user'] && window['logged_in_user']['softr_user_email']) { typeformUrl = typeformUrl + 'email=' + window['logged_in_user']['softr_user_email']; typeformUrl = typeformUrl + '&name=' + window['logged_in_user']['softr_user_full_name']; typeformUrl = typeformUrl + '&recordId=' + window['logged_in_user']['airtable_record_id']; } document.write('<div class="typeform-widget" data-url="' + typeformUrl + '" style="width: 100%; height: 500px;"></div>'); </script> <script> (function() { var qs,js,q,s,d=document, gi=d.getElementById, ce=d.createElement, gt=d.getElementsByTagName, id="typef_orm", b="https://embed.typeform.com/"; if(!gi.call(d,id)) { js=ce.call(d,"script"); js.id=id; js.src=b+"embed.js"; q=gt.call(d,"script")[0]; q.parentNode.insertBefore(js,q) } })() </script>
Thank you. Iāll try this now. I noticed an airtable mention. Whatās that for?
btw, it worked!!! Thanks so much.
Would this work with any other form software like Cognitoforms?
Hey again, I wanted to avoid the scrolling happening in the typeform embed code that you had me put in the block. here is the new div block typeform gives me to accomplish this, but the hidden field info isnāt passedā¦how can I add it back in? Here is what the code from typeform is: <div data-tf-widget="z2yvRhCe" data-tf-opacity="100" data-tf-iframe-props="title=New Buyerbucket Buyer Profile" data-tf-transitive-search-params data-tf-disable-scroll data-tf-auto-resize data-tf-medium="snippet" data-tf-hidden="name=,email=" style="width:100%;height:499px;"></div>**<script src="//embed.typeform.com/next/embed.js"></script>