Hello!
I currently pass data successfully to my Fillout forms through the URL.
Here is an example: https://forms.homehealthwork.com/t/hwVKArU6HLus?user_id=xxxxx&agency_id=xxxxx
In this example I populate the user_id and agency_id from my Airtable base, using the ID field in the USER table and ID field in the AGENCY table.
However, I would like to now embed this Fillout form on a Softr page, and pass the user_id and agency_id using the Custom Code Block on my Softr page.
I attempted it with the following lines in the Custom Code Block, but can’t seem to do it correctly.
<div class="w-400 text-center"><p class="h6">
<script>
let filloutUrl = 'https://forms.homehealthwork.com/t/q4qQWTmCP5us';
if(window['logged_in_user'] && window['logged_in_user']['airtable_record_id']) {
filloutUrl = filloutUrl + '?record_id=' + window['logged_in_user']['airtable_record_id'] +'&agency_id=' + window['logged_in_user']['agency_id'];
}
document.write('<iframe src="' + filloutUrl + '" width="100%" height="2000" frameborder="0" marginheight="0" marginwidth="0" title="My Application"></iframe>');
</script>
</p></div>
And here is a copy/paste from the Fillout embed code generator:
<iframe
src="https://forms.homehealthwork.com/t/hwVKArU6HLus?record_id=xxxxx&agency_id=xxxxx"
width="100%"
height="2000px"
frameborder="0"
marginheight="0"
marginwidth="0"
title="Agency Work Agreement"></iframe>
Any help would be greatly appreciated!