Manual pagination to a read only grid

Certified Associate Developer

I have a read-only grid that uses an expression rule as its data source. Now, I want to implement manual pagination. When a user clicks on the 'Next' button, it should trigger a request to the API to fetch the next set of data, which will then be displayed on the interface. Is this doable in Appian?

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Not sure what you mean. A grid supports paging by default. You just need to configure your query correctly.

    Can you share your code?

  • 0
    Certified Senior Developer

    You can user pagingSaveInto parameter to save your paging details and can pass those details to API.

  • 0
    Certified Senior Developer

    Hello  

    Here I assume you have a batchSize predefined in your expression rule. if not, You need to set it and in the grid button pass the Next startIndex and batch size into the query parameters. 

    More insights for us on your code more answers on your question. Please share your code snippet.

  • 0
    Certified Lead Developer

    You need to understand the mechanics of how a grid works by default.  Clicking "next page" simply saves a new value (via the "paging save into" parameter, when set up to use external paging) into the 'paging info' variable, namely the "start index", which will be simply set to the previous start index + the page size.  That new start index value, in normal use cases, will trigger a re-query of data (based on Appian refreshing the queried data when the referenced paging info variable changes), which then causes the grid to update.

    If you can figure out a way to trigger a data refresh based only on the Start Index being updated, then this plan might have a way of working.  However I'm less sure about having it fire an API call (unless i'm reading your original scenario wrong).  But if your expression rule accepts a "start index" and updating that can trigger a refresh, then that might be all you need?