Skip to main content
March 8, 2024
Question

Manual pagination to a read only grid

  • March 8, 2024
  • 4 replies
  • 0 views

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?

    4 replies

    stefanhelzle0001
    Brainy
    March 8, 2024

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

    Can you share your code?

    March 8, 2024

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

    konduruc733182
    March 8, 2024

    Hello [mention:0d77b95d889c420097b2afce6f897f56:e9ed411860ed4f2ba0265705b8793d05] 

    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.

    mikes0011
    Brainy
    March 8, 2024

    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?