a!pagingInfo() Function

Creates a value of type PagingInfo for use with grids, queries, and todatasubset().

Syntax

a!pagingInfo( startIndex, batchSize, sort )

  • startIndex (Integer): Index of the array in which to start returning values for the subset. Valid values include those greater than zero.
  • batchSize (Integer): The number of items to return. Valid values include those greater than or equal to -1.
  • sort (SortInfo Array): Valid values include null, an empty array of SortInfo, or an array of SortInfo where <SortInfo>.field is the name of a field on the input array elements or "dot" notation for a nested field.

Returns

PagingInfo

Notes

If the startIndex value is greater than the total number of items in the list the PagingInfo value is applied to, a null array is returned as the data.

If the batchSize value is greater than zero, the function your PagingInfo is applied to returns a subset with at most the batchSize number of values starting at startIndex.

If the batchSize value is -1, all items are returned. When People Functions contain PagingInfo, the batchSize parameter must be greater than or equal to zero; -1 is not a valid option.

If the batchSize value is null or zero, the totalCount and startIndex of the array is returned, but no data.

If the sort value is not null or empty, the function your PagingInfo is applied to returns a subset of the input sorted by the field value of the SortInfo. If the value is null or empty, it returns an unsorted subset of the input.

Examples

You can copy and paste these examples into the Expression Rule Designer to see how this works.

1
2
3
4
5
6
7
8
	=a!pagingInfo(
	    startIndex: 1,
	    batchSize: 4,
	    sort: a!sortInfo(
	      field: "name",
	      ascending: true()
	    )
	  )

returns

	[startIndex=1,
	 batchSize=4,
	 sort=[field=name, ascending=true]]

See Also

a!sortInfo(): Use this function to create your SortInfo value for the sort parameter.

PagingInfo: This is the data type the a!pagingInfo() function returns.

Read-Only Grid: Use the a!pagingInfo() function to page and sort the data for a grid component on an interface.

Open in Github Built: Wed, Aug 17, 2022 (01:05:05 PM)

On This Page

FEEDBACK