Skip to main content
Known Participant
Aug 28, 2021 12:56 PM UTC
Question

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

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
    Aug 28, 2021 3:19 PM UTC

    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?

    Known Participant
    Aug 28, 2021 3:23 PM UTC

    show only 500 rows.

    stefanhelzle0001
    Brainy
    Aug 28, 2021 4:14 PM UTC

    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
    Aug 29, 2021 5:51 AM UTC

    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?