Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Stanley Mok
717
Views
8
Comments
Solved
Pagination of RESTful API Response
Question
REST
How do I paginate a Record Table with data coming from a RESTful API?
It is not an entity and cannot be dragged into the main screen flow. The RefreshData widget cannot find compatible data source.
Stanley
Pedro Cardoso
Solution
Justin James
wrote:
You could still paginate if you did a bit of work. There are methods to pull the requested page number, and number of records per page, if you look at the scaffolding-created actions you will see how it works. You could use that to pass to the REST API. You *may* need to inject fake records into the results list before the current page to pad it out, if memory serves.
J.Ja
Indeed. Still, it really depends on the amount of records, and how fresh your data needs to be.
- Few data expected and fresh data is required: go with J.Ja. solution;
- Large amounts of data and fresh data is not required: go with a local database cache;
- Large amounts of data and fresh data is required: the 3
rd
party needs to implement pagination, unless it’s impossible. BTW: you’re getting unreasonable requirements. Run away!)
See solution in context
Pedro Cardoso
Hello Stanley,
As for the scafolding that is done by dragging an entity to screen, keep in mind that all the magic that happens on the created screen can be achieved by hand. All the components used are either widgets like table records, or stuff from Rich Widgets. Spend some time analysing them and you'll see that there's a lot to learn there :)
About pagination of the data that is coming form your RESTful API. I would try to first understand if that API supports pagination by itself. If it does, you could try to take advantage of that and try to compose a screen that uses RichWidgets blocks and work from there. I can help if you need. If the API itself does not support pagination, I guess that you'll need to go with a local database cache where you save the results.
Cheers
Pedro Cardoso
Stanley Mok
The RESTful API does not support pagination. Do you have an example of one which supports pagination?
Thanks,
Stanley
Pedro Cardoso
Hey, that's not good :(
Check this good example:
https://developer.zendesk.com/rest_api/docs/core/introduction#pagination
Stanley Mok
Thanks.
Luis Camarena
Good stuff.
Justin James
Â
MVP
You could still paginate if you did a bit of work. There are methods to pull the requested page number, and number of records per page, if you look at the scaffolding-created actions you will see how it works. You could use that to pass to the REST API. You *may* need to inject fake records into the results list before the current page to pad it out, if memory serves.
J.Ja
1 reply
07 May 2016
Show thread
Hide thread
Pedro Cardoso
Solution
Justin James
wrote:
You could still paginate if you did a bit of work. There are methods to pull the requested page number, and number of records per page, if you look at the scaffolding-created actions you will see how it works. You could use that to pass to the REST API. You *may* need to inject fake records into the results list before the current page to pad it out, if memory serves.
J.Ja
Indeed. Still, it really depends on the amount of records, and how fresh your data needs to be.
- Few data expected and fresh data is required: go with J.Ja. solution;
- Large amounts of data and fresh data is not required: go with a local database cache;
- Large amounts of data and fresh data is required: the 3
rd
party needs to implement pagination, unless it’s impossible. BTW: you’re getting unreasonable requirements. Run away!)
Stanley Mok
Thanks for the discussion. I got more than I asked.
The API is internal developed but quite old. If changing it is not possible I will try to get the raw data from database via an extension.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
 Loading...