Skip to main content

I have an API script like the below. This works fine as a scripting Extension (right panel) but when I place the script into an Automation Script step, Airtable gives the error "ReferenceError: FormData is not defined".

Any ideas why it would work in one place but not the other? 

const myHeaders = new Headers();
myHeaders.append("Authorization", apiKey);

const formdata = new FormData();
formdata.append("file", fileBlob);

const requestOptions = {
method: "POST",
headers: myHeaders,
body: formdata
};

let postResponse = await fetch(apiUrl, requestOptions);

 

Be the first to reply!

Reply