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 / Not possible to use th...
Power Apps
Answered

Not possible to use the First and Filter functions inside an Update If function

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Is there any way to use the UpdateIF and just filter the first record it finds, unlike all the records that fall under the same conditions?

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    I believe this is the same question as your other post?  If so, check out my response there.

  • Pstork1 Profile Picture
    69,657 Most Valuable Professional on at

    Rather than use a combination of First and Filter couldn't you just use Lookup()?  That always returns the first record it finds that matches the formula.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Pstork1 

    Yes, using the Lookup should be the preference over First(Filter(

    In this particular case, I left the solution as such because it was assumed that there might be some other logic for determining the "first".  In other words, one might want to filter specifically something else and/or apply some sort criteria (ex. the first of the most recent date).

    If none of the above applies - then yes, go with Lookup.

  • Pstork1 Profile Picture
    69,657 Most Valuable Professional on at

    Agreed.  Just offering a different solution that the poster may have overlooked.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Pstork1 

    Yes...I was kind of anticipating a "But, I need to get the first record that is actually ______".  Sort of baiting the next step Smiley Very Happy

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

    Hi @Anonymous ,

    Do you only want the UpdateIf function to update the first record which match the filter condition within your UpdateIf formula?

     

    If you want the UpdateIf function to only update the first record which match the filter condition within your UpdateIf formula, I afraid that there is no way to achieve your needs in PowerApps currently.

    The UpdateIf function would update all records which match the specific filter condition in a data source. More details about the UpdateIf function, please check the following article:

    UpdateIf function

     

    If you want to update the first record which match the filter condition you specified, I think the combination of Patch function and LookUp function could achieve your needs. Please consider take a try with the following formula:

    Patch(
     'YourDataSource',
     LookUp('YourDataSource', PrimaryColumn = "A specific value"), /* <-- Find the first record which match the filter condition */
     {
     Column1: "xxx",
     Column2: "xxx",
     Column3: "xxx",
     ...
     }
    )

    Or

    Patch(
     'YourDataSource',
     First(Filter('YourDataSource', PrimaryColumn = "A specific value")), /* <-- Find the first record which match the filter condition */
     {
     Column1: "xxx",
     Column2: "xxx",
     Column3: "xxx",
     ...
     }
    )

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

     

    More details about the Patch function and LookUp function in PowerApps, please check the following article:

    Patch function

    LookUp function

     

    Best regards,

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 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard