403
Views
5
Comments
Solved
Pagination/Navigation with Data Action Output List
Application Type
Reactive

Hi everyone ! 

It is my first week on OutSystems. I'm trying to paginate by 10 records a list which gets the records from a SQL personalized query. But I don't know how to proceed !

2.PNG
5.PNG
1.PNG
3.PNG
2024-08-20 07-51-02
David Nieuwenhuizen
Champion
Solution

Hi Gabriela,

You have to add a new input parameter to the sql query to know your startIndex, which you can use in the SQL with an "OFFSET" statement. Then you need to perform a seperate count query to get the TotalCount.

Also, check this post: https://www.outsystems.com/forums/discussion/56770/sql-offset-and-os-pagination/ 

Hope it helps!

2024-08-20 07-51-02
David Nieuwenhuizen
Champion
Solution

You're very close!

You cannot use the count from the other SQL query since the count will always be 10. So therefore you have to do the SQL query again. You can copy the SQL query without the pagination part and with SELECT count(*). This will get you the maxRecords. 

2023-10-21 19-42-11
Tousif Khan
Champion

Hello

For pagination with Advance SQL widget there are multiple post there you can check them here:-


Hope this helps
Best Regards
Tousif Khan

2024-08-20 07-51-02
David Nieuwenhuizen
Champion
Solution

Hi Gabriela,

You have to add a new input parameter to the sql query to know your startIndex, which you can use in the SQL with an "OFFSET" statement. Then you need to perform a seperate count query to get the TotalCount.

Also, check this post: https://www.outsystems.com/forums/discussion/56770/sql-offset-and-os-pagination/ 

Hope it helps!

UserImage.jpg
Gabriela Telega

I followed one of the examples, but still having one issue. I think i know what is the problem but i don't know how to solve it. I make the count on CandidateHardSkills, but that entity is always empty, I need to make the count on the CandidateHardSkills List ( output of the first query). I am thinking rigth ? Thank you so much for helping me !!

9.PNG
8.PNG
7.PNG
6.PNG
2024-08-20 07-51-02
David Nieuwenhuizen
Champion
Solution

You're very close!

You cannot use the count from the other SQL query since the count will always be 10. So therefore you have to do the SQL query again. You can copy the SQL query without the pagination part and with SELECT count(*). This will get you the maxRecords. 

UserImage.jpg
Gabriela Telega

I've solved it already. I'm leaving the app just in case anyone else has similar doubts to mine, so they can use my experience as a reference. Thank you very much for your help! 

HIREmeWork.oap
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.