Getting latest entry by date

Hi all,  In my app I have property valuations (entity of it's own, shown in a date grid with Valuation Date and Valuation). Doing it this way means that we can see valuation history as well. As it is just a table of all the valuations that have/will be done on the property.   I would like to see the latest valuation on the property information page.  I have set up attribute called "LatestValuation" and used a microflow to calculate its value.  Here's the microflow.  So it Retrieves > Sorts by Date > Takes Maximum value and returns it. This microflow returns the highest valuation regardless of date. the aggregate function does not see the Date attribute (i think this is because the microflow is set to return a decimal.Does anyone know how to make it return the valuation with the latest date?  Another option I have looked at is rather than doing it at the entity level, it commits to the 'LatestValuation' when you click save on the page which adds valuations. My first few attempts have been unsuccsesful.  Does anyone have any suggestions on how best to achieve this? Many thanks,  Garion
2 answers


Retrieve the list sorted by date descending (so the most recent entry is at the top of the list).  Then use List operation Head to get the top object and return the valuation attribute of the object returned by that List operation.




It seems like you are using an additional attribute that is calculated. But you want to show the latest object in a dataview.

Create a dataview and select "Microflow" as datasource. In this microflow, you can do a retrieve sorted by date descending with the option "first" selected. This will result in getting only the latest valuation (In one single action). Now return it and enjoy it in your dataview.