Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

FormData not supporting in Automations

Topic Labels: API Scripting
42 0
cancel
Showing results for 
Search instead for 
Did you mean: 
auekk2787
7 - App Architect
7 - App Architect

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);

 

0 Replies 0