How can I query data via API using a from with Wappler?

Hi there, I have a data connection that I would like to use a form to build the query for the API call.

Example, we can use an API to search through a database of articles, I’d like to build the form for our users to input their search queries, on submit we query the article database and return articles matching the search query.

The results come back in JSON so we’d then like to build a repeating group to map the JSON items (e.g. the image, title).

How would this be achieved with Wappler?

Matt

Server Connect uses JSON as its internal format so any database/API queries return JSON as the result. App connect then parses the json and outputs as HTML

You could use an API or simply pass the users queries across the database in a custom query if you have access.

The Server Connect API can be used to query pretty much any JSON API

On the basic information you have given cant be much more specific than that.

Thank you for your reply, much appreciated.

Basically, there is a big database of articles that we can access via API. They return JSON for each query.

We want to provide our users, let’s say with 4 form fields, these could be ‘Industry’, ‘Location’, ‘Content Type’, ‘Number of Articles’.

With postman, I’m able to connect and retrieve article lists, but the parameters are inputted manually.

But, if I create a form with 4 form fields and a ‘search’ button in Wappler, I’d like the form to build the correct API call by changing the body parameters with variables. E.g. [“Industry”] would change to [“Software”] if that is what the user types in that specific Industry form field.

I’m sure this is a super simple, normal thing to create - but I’ve had a bit of trouble with Bubble and wanted to understand if this is possible with Wappler. I’m very new to API’s.

You simply need to POST the form to your server action and then set the parameters in the server API to those values something like this:

Obviously you would call your parameters etc more appropriately for the purpose intended for them.

1 Like

It is as simple as Brian (@Hyperbytes) has put it.

The old saying: Have gun, will travel.
The new saying: Have Wappler, will solve.