Now I need to get data from a other airtable fields. For example the field status under âcontactsâ table on airtable
Also I need to get a record ID from a detailed page where the form is embed. There is a list detail block in the same page I have the custom code block. The ID I need is called âID eventoâ under âeventosâ table" . is the same ID from the Page URL as we are in a detailed page.
To display data from other table than âusersâ , simply add the table to your page and map the needed values in this new block. Then hide it with css. Now the values for that record can be accesed from the window.records object. And then can be placed anywhere on your page, or can be passed as parameters to your fillout form.
Also accesing the record id in your url can be done with some code like:
Ok, I thought that record id you needed it was listed in the url.
First you must have listed on the details page the value that you expect to grab.
It can be hidden with css but it must rendered so we can access it.
Then you can try this:
<script>
// Get record field values to map them into section
const wait = setInterval(function () {
if (window.records !== undefined) {
clearInterval(wait);
document.getElementById("service-name").innerText = window.records[Object.keys(window.records)[0]].record.fields['Service name'];
document.getElementById("service-description").innerText = window.records[Object.keys(window.records)[0]].record.fields['Service description'];
}
},1000)
</script>
<!--Now lets show the dynamic values into page -->
<div id= 'service-name'></div>
<div id= 'service-description'></div>
Thanks Janathan. Now i cannot understand anything lol. SOrry, I am not technical.
The code below is what is working right now. I am retrieving user id , email and name. I need to retrieve the record ID from table (eventos). This ID is also in the URL because is a detailed list.
HI Jonathan, I have replaced my code with yours abd now all data I need is retrieving. thanks a lot! Now I am able to get any variable from the user table and also the page URL Id
@acjnasdocument.write is not the right way to inject I would rather have a container div element and then append iframe into that div via the following code like snippet
<div id="targetDiv"></div>
<script>
// Select the div where you want to insert the iframe
var targetDiv = document.getElementById('targetDiv');
// Create the iframe element
var iframe = document.createElement('iframe');
// Set the attributes for the iframe
iframe.setAttribute('src', 'https://www.example.com');
iframe.setAttribute('width', '600');
iframe.setAttribute('height', '400');
iframe.setAttribute('frameborder', '0'); // Optional: Set to 0 for no border
iframe.setAttribute('allowfullscreen', 'true'); // Optional: Allow full screen
// Append the iframe to the selected div
targetDiv.appendChild(iframe);
</script>
I was sent here by Softr support, but have MANY questions (and this code isnât working for me). I had a working page built in Softr (working for over 6 months). I was successfully using Fillout form.
My page had (in this order):
the header then
a text block then
a form embedded using custom code block with iframe then
a footer
Suddenly 2 days ago I woke up and all my pages with forms (not just Fillout forms, but Tally.so forms as well), ALL my pages suddenly moved the form portion to below the footer. I did not make any changes in the forms or my Softr pages. FYI the page still works, the form works only to position of the form has moved to below the footer.
Does anyone have any ideas why suddenly my forms are all below my footer? More importantly, how do I fix this? Softr support is saying âFillout form issueâ but I am skeptical as this is happening with all forms (not just Fillout).
I hope someone can help or at least point me in the right direction. I have been a long time PAID CUSTOMER of Softr, but if the platform canât be stable and provide EXCELLENT SUPPORT, I am being forced to move my business elsewhere.
Here is the code I have been using to embed my Fillout form:
Hey @TeaDrinkingHacker I will be more than glad to help you with this! I already found your app where you contacted us yesterday, all we need to do is the adopt the method mentioned above by Artur which was Using document.write for injecting content is not recommended due to its potential to overwrite the entire document and cause performance issues. Instead, it is better to use a container div element and append an iframe into that div. I DM-ed you the proper code just simply please change it with the one you have.