How to make form that will create new record in external base (Airtable) via API

Hello!
Discovering Wappler for myself and seems like it is fantastic app! But today I stuck with one problem and need help.

I can’t figure out, how to make simple form that will create new record in my Airtable base. https://airtable.com/ Maybe someone can give me advice pls?

Correct request for new record is this:
POST https://api.airtable.com/v0/appDZP5VfCowwa7ue/Persons
Authorization and Content-Type in header.
Body text like this:

{
“records”: [
{
“fields”: {
“Name”: “Tony Stark”,
“Occupation”: “engineer”,
“Age”: “40”
}
}
]
}

I checked in Postman, that this request is working.

In Wappler I create bootstrap form with 3 text inputs and one button.
image

I tried two ways.
First way, I select “Make API Form” in form properties. Then change method to “post”, write request url, choose Post Type: JSON, write api headers (authorization and content-type) and defined API Schema.


For API Schema I paste example above in Source textarea, press “process” button and save resulted schema. Also I tried another different schemas configured manually, but it all the same.

Finally, when I go to page in browser and fill the form and press Submit, I get this error in browser’s log:

{,…}
error: {type: “INVALID_REQUEST_MISSING_FIELDS”, message: “Could not find field “fields” in the request body”}
message: “Could not find field “fields” in the request body”
type: “INVALID_REQUEST_MISSING_FIELDS”

Also, I see that body of request is like {“Name”:“aaaaa”,“Occupation”:“bbbbb”,“Age”:“23”}
So, it seem like the problem is that I can’t define schema correctly. Or I missing something.

Second way, I tried to make Server Connect Form. I’ve created API and action step in it. I write URL, method, data type, headers and schema in it. And I change my form to “Make Server Connect Form” and then select server action. Result: the same.

Will appreciate any suggestions.

Community Page
Last updated: