Help

Using FormData in scripts

Topic Labels: Scripting extentions
1035 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Tom_Beckenham1
4 - Data Explorer
4 - Data Explorer

Hi,

I’m getting an error when I try to use create a Javascript FormData object in preparation for posting to an API. I would have thought FormData would have been well supported.

console.log(`Hello, ${base.name}!`);
const endPoint = new URL('https://myserver.com/jsonAPI/');
const formData = new FormData();
formData.append("user", 'tom');

const response = await fetch(endPoint.toString(), {
    method: "POST",
    body: formData,
});

console.log(response)

Getting an error saying that FormData is not defined

1 Reply 1
Thomas_Brady
4 - Data Explorer
4 - Data Explorer

They mention in their docs that the FormData API is not available in Airtable Scripting: Airtable Scripting