Skip to main content

FormData not supporting in Automations

  • September 26, 2024
  • 0 replies
  • 19 views

auekk2787
Forum|alt.badge.img+12

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