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?
Pieter van de Braak
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.
Sebastiaan van den Broek
retrieve the list with sorting appointment date descending.
create new list of the same type
create int var
loop over the retrieved list and add the object to the new list
change the var=var+1
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.