web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Refer to a Filter resu...
Power Apps
Answered

Refer to a Filter result in a formula

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

I am currently trying to make an 'Inventory App' for my company.
I use a SP List. I implemented an option to book a certain Item, but now I am looking for a way to kind of put the Item back into storage.
When booking an item I let the App create a new Entry with the same name and the desired amount, which gets substracted from the original one.
The 'back into storage' function so far looks like this:

Patch(
Inventar;
First(
Filter(
Inventar;
Title = InventarGalerie.Selected.Title && ID < InventarGalerie.Selected.ID
)
);
{Anzahl: + InventarGalerie.Selected.Anzahl}
)

For reference: Anzahl = Amount, Inventar = SP List, InventarGalerie = Galery that displays the list

The first part seems to work fine, but I have no idea how i can refer to the filter results in my formula.
I think i need something like {Anzahl: FilterResult + InventarGalerie.Selected.Anzahl} .


Any help will be apreciated.

Categories:
I have the same question (0)
  • timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    Hi @Anonymous 

    Unless I misunderstand you, you'd like to refer to the record that you've just updated with Patch.

    If that's the case, it's worth noting that the return value from Patch contains the updated record.

    For example if you use the following formula, you can use LastUpdatedRecord to refer to the record that you updated.

     

    Set(LastUpdatedRecord;
    Patch(Inventar; First( Filter( Inventar; Title = InventarGalerie.Selected.Title && ID < InventarGalerie.Selected.ID ) ); {Anzahl: + InventarGalerie.Selected.Anzahl} )
    )

     

     

     

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you please share a bit more about your scenario?

    Do you want to reference the Filtered result from the Filter formula within your Patch function?

     

    If you want to reference the Filtered result from the Filter formula within your Patch function, I have made a test on my side, please consider modify your formula as below:

    Patch(
     Inventar;
     First(
     Filter(
     Inventar;
     Title = InventarGalerie.Selected.Title && ID < InventarGalerie.Selected.ID
     )
     );
     { /* <-- Modify your formula below */
    Anzahl: First(Filter(Inventar; Title = InventarGalerie.Selected.Title && ID < InventarGalerie.Selected.ID)).Anzahl + InventarGalerie.Selected.Anzahl
    } )

    Please take a try with above solution, check if the issue is solved.

     

    More details about Filter function in PowerApps, please check the following aeticle:

    Filter function

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-xida-msftThank you for the quick response, the solution you provided works!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard