Hi, I am using a web/REST service inside a microflow to get a "data grid" data, and to optimize data access I have parameters to limit the returned number of items. How can I get the pagination parameters (like sort by, start at, limit to...etc) inside a data source microflow feeding a data grid widget? Thanks
You can do that using the GridView from the "TreeView and GridView" module from the appstore.
You need a new entity that you call, for instance, PagingContext. You give it three Long attributes: Offset, Limit and Count.
Take the PagingContext as a parameter to your microflow
On the page, add a Data view for the PagingContext that has a microflow datasource that simply creates an empty PagingContext
Add a Grid View to the Data view. In its properties, select the microflow as the source, and select the offset, limit and count attributes
In the microflow, you can now use the Offset (that is, PageSize * PageNumber) and the Limit (PageSize) attributes. The microflow needs to set the Count attribut on the PagingContext, to let the Grid View know how many items there are in total
In the retrieve action use
Chris de Gelder
You can use the list operation - sort action activity in your microflow to achieve the sorting bit. This will also influence your 'start at'.
Influencing the actual paging buttons/load more button isn't possible as far as I know, so you'll have to do with sorting your list and if necessary removing items from your list to create a limit.