Documentment template datagrid size

We are using a document template as a report and wish to limit the size of some datagrids it contains. For example, one of the datagrids should show the last 10 appointments how could i acchieve this without having to create a loop that loops 10 times over the complete list of appointments to add the last 10 appointments?
2 answers

Unfortunately you cannot get a fixed amount of items in a microflow, so I would retrieve the objects in a Java action instead, there you can do an xpath query limited by amount. You can just pass this list to the generate document action in your microflow.

If the datagrid is nested, use a microflow as data source and call the Java action there.

  1. retrieve the list with sorting appointment date descending.
  2. create new list of the same type
  3. create int var
  4. loop over the retrieved list and add the object to the new list
  5. change the var=var+1
  6. check the no = 10 if yes go straight with your micro-flow if no draw the arrow back to a merge before the loop to add the next object and so on till the tenth object.
  7. or you can use a java action :) .