Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

FormData not supporting in Automations

Topic Labels: API Scripting
803 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