I’ve embedded an airtable form in a page built with webflow.
I wanted to prefill airtable form using the URL parameter, but I don’t know how to do it.
First, I embedded the airtable form in a page built with webflow, referring to the following site
Then I realized that I can write prefill directly in the embed code.
However, what I want to do now is to prefill the embedded airtable form using the URL parameter, but I don’t know how to do it.
I have a feeling that I can do it by applying the code in the URL below, but the code is too complicated for me to understand.
I’m using deepl, so I apologize if the wording is confusing.
Edit the below script according to your needs and install it into the ‘before body tag’ of your webflow page:
let myIframe = document.getElementById("myIframe");
let endpoint = "https://airtable.com/embed/xxxxxxxxxxxxxx";
let url_string = window.location.href;
let url = new URL(url_string);
let name = url.searchParams.get("name");
let email = url.searchParams.get("email");
let fullURL = endpoint+"?prefill_Name="+name+"&prefill_Email="+email;
myIframe.src = fullURL;