API SC Action - Pagination!

Hey all,

Having a bit of a love affair with Wappler today, making great progress.

One thing I’m stuck on, is I have an API returning document data (JSON via ElasticSearch), the documents can be in the hundreds of thousands so naturally need to setup paging.

It’s been easy to setup the number of records to return in the JSON request, and they appear to have a fairly straight forward way of paging:

{
  "from": 5,
  "size": 20,
  "query": {
    "match": {
      "user.id": "kimchy"
    }
  }
}

What I’m stuck on - is that it looks like, and from posts on the forum that the paging generator in Wappler will not support custom API data, there was a post here that @Teodor helped out a user via private message but no other comments on the forum.

I thought I’d be able to use the paging generator, query manager with offset and the same data source as the repeat - but the pager just isn’t working.

I query the API currently via a form submit, so what I’m thinking of doing is a hidden field called ‘offset’ and create an event on a standard paging function - however, without this being connected to the API, it can’t really display to the end user how many pages exist.

Open to any suggestions if someone has paging working on an API.

Community Page
Last updated: