do not limit number of rows in data grid

• Business is looking for displaying all the cases in the system specific to a user and enabling administrators to choose specific cases and do an owner reassignment. We plan to go with a Data grid and microflow data source to list down all the cases specific to a user so that administrator can choose specific cases and click on reassign button that would call a microflow to do the reassignment logic. We see an issue with this if user selects a huge set of cases and click on reassign then the all cases are loaded in memory and passed on to the microflow. This would create memory issues in the system if too many objects are loaded in the memory. If there is an option to set at the data grid the maximum number of cases (objects) that can be selected then it would be easy to limit the objects in memory. We would want to cap the maximum of reassignments in one go to avoid performance issues and system crash. 
3 answers

How many records you assume to be selected in one go?
I doubt it would create performance issues or system crash in this scenario. Maybe try testing with full load and see if the performance is desirable or not.
Otherwise one solution could be to create another entity SelectionHelper. Now in datagrid you can place a button to add records into current selection. This button will retrieve first SelectionHelper entity object and associate it with the list of selected records. (Create an association between SelectionHelper and your other entity)
Now you can access your selected records list from a single reference of SelectionHelper. 
When you want to process the records, you can do it in batches by retrieving your desired amount of selected records. At the end you may delete the helper object.


In a datagrid there is no default option to maximize the number of objects selected. However if you use a microflow for this selection you can build this logic yourself by:

  1. Counting the list that microflow gets as a parameter
  2. If the count is higher then x pass a message to the user, else continue the flow




The problem is probably with your datasource microflow for the datagrid to begin with. With a MF datasource, as a result all the objects returned by the microflow are passed on to the client and not only the items which are shown (ie. 1-20 of 5000).  This could already cause your performance problems. You should find a way model this differently, like limit the retrieve with a custom setting or use a Xpath contraint on the datagrid as to limit the objects send to the client.

Example below is for two different requests:

first  XAS request is a DB source datagrid with 20 rows with database source:

Second XAS request is for MF Source Datagrid with 20 rows with a custom limit of 5000 on the retrieve in the microflow:


As you can see with a microflow source datagrid all object retrieved in the microflow are sent to the client.