Retreive all last items of a set of associations

Hi all, i have a data model with Member 1 <---- 0 Activity. I need to retrieve all last activities; e.g. the last activity of each member (based on a datetime attribute). Can i express this in a single retrieve with an XPath expression, or do i need to loop over all members?
1 answers

You could solve it in the data model by adding an boolean attribute that states if the record is the last submitted record. So default is true. Then an event MF that will set the previous record to false. Now in the microflow you can simply create a retrieve activity with an XPath query on the boolean attribute value.