Skip to main content
August 28, 2021
Question

how to show first 'n' rows in read only Grid

  • August 28, 2021
  • 6 replies
  • 0 views

Hi ,

I am using Record type as a data source as grid field . I have the requirement to show the first 500 record list in the grid after applying filters and sorting. I did something like this.

local!pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 500),
a!gridField(
    label: "Read-only Grid",
    labelPosition: "ABOVE",
    data: local!employeeData,
    columns: {
      a!gridColumn(
        label: "First Name",
        sortField: "firstName",
        value: fv!row.firstName
      ),
      a!gridColumn(
        label: "Last Name",
        sortField: "lastName",
        value: fv!row.lastName
      )
    },
    pagingsaveinto: local!pagingInfo
  )
I understand batchsize will not help as it will return 500 rows for each page. Can some one help here





    6 replies

    stefanhelzle0001
    Brainy
    August 28, 2021

    Did you check this?

    https://docs.appian.com/suite/help/21.3/read-only-grid-configuration.html#paging-&-sorting

    Do you want to show only 500 rows at all, or 500 per page?

    August 28, 2021

    show only 500 rows.

    stefanhelzle0001
    Brainy
    August 28, 2021

    Interesting requirement ... what's the purpose?

    I would create an expression which fetches the data including paging info for paging in the grid. Then I would manipulate the totalCount attribute using a!update to be 500 or less.

    Then the grid should manage everything else.

    Participating Frequently
    August 29, 2021

    You could create a View by selecting * from the table, sort it by ID and LIMIT the result by 500 and then use this View as a data source. Would this help your use case?