How to implment Infinite scrolling(Extendable Verticle Scrolling) on API response?

Actually,i have an API that returns 10 posts in single API call.I pass offset to the api and it returns at max 10 posts in single api call on base of provided offset.How can i display these posts in repeating group with extendable verticle scrolling.So,that when i reach at page end,it automatically fetch new posts from api and display them on the page.

look into the elements in view plugin…there is a forum post on the topic of plugin and a user demonstrated it using a rg which would load new results after user scrolled…you’d be able to implement something similar but will need to incorporate your api calls and also change the offset in the call.

@boston85719
I want to implement the same thing for RG. Initially there are 10 records in RG and when user reached to bottom of RG then it should automatically call the API for next 10 records which will get append to the previous RG Data.

How to detect the user has reached bottom of RG event in workflow?Also how to append the next 10 records to the previous RG data.

I’m sorry but the answer to your question is the same as I posted above.

@boston85719 Can you please share that post. I am unable to find that on the forum. I want to implement a similar feature where I want to call external api which will scroll infinitely which is limit and offset based. I am stuck on this for a week now. I can implement it based on a “next” and “previous” button as an alternative, but I prefer infinite scroll for a good user experience.

I think @boston85719 means this one:

What you also need is to understand how the API call works.

Steps would be something like:

  1. First API Call
    you will get back some content as well as a nextPageToken

  2. When User scrolls to last entry of your results → make another api call with your nextPageToken from result 1.

  3. Do this until nextPageToken is empty

Try to reproduce this and it will work. (Without that plugin you could go with a button to load the next results.

I am referring to this plugin. You may have luck searching the forum for the thread.