Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerApps: getting most recent record having a condition

Is it possible in PowerApps to get at the latest record, from a SharePoint list, having a certain condition? In my case I know how to get the number, using something like this:

CountIf(Applications, Status = "Pending")

But, I would also like to get the most recent one of them. Well I suppose that would imply two conditions where the second is a Date column, but is it possible to sort it and then pick the first? Grateful for any guidance...

like image 883
Perry J Avatar asked Oct 17 '25 13:10

Perry J


1 Answers

Yes, you can use an expression that sorts the filtered data source by the date in descending order, and take the first element, like in the expression below:

First(
    SortByColumns(
        Filter(Applications, Status = "Pending"),
        "DateColumn",
        Descending))
like image 70
carlosfigueira Avatar answered Oct 21 '25 19:10

carlosfigueira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!