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 / ForAll - patch multipl...
Power Apps
Answered

ForAll - patch multiple records in table

(0) ShareShare
ReportReport
Posted on by 5

I'm only a couple of months into my power apps experience. So, the question might be basic, but still, I'm struggling.

 

I've been trying for a while to get this code to filter all items in a table and edit a specific field for all matching filter. Don't know if it is syntax or I'm using the functions wrong...

 

ForAll(
 Filter(
 // Filter out the records that contains the SetID in variable selectedSet
 BatteryTbl, SetID = selectedSet
 ),
 Patch(
 BatteryTbl,
 LookUp(BatteryTbl, BatteryID = ThisRecord.BatteryID), 
 {
 // Set the Location field of record to the selected item in a dropdown box.
 Location: locationdd.SelectedText
 }
 )
)

 

 Any help would be appreciated. 

 

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @MrDrone ,

     

    Please try this formula :

    UpdateIf(BatteryTbl,SetID = selectedSet,{Location: locationdd.SelectedText})

    I think this link will help you a lot:

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-update-updateif

     

    Best Regards,

    Bof

  • MrDrone Profile Picture
    5 on at

    That is awesome. Thank you both for the formula and the link. That formula is so much cleaner and works perfectly. Just had to add .value to the SelectedText in the dropdown to get text variable and not the record.  

    UpdateIf(BatteryTbl,SetID = selectedSet,{Location: locationdd.SelectedText.Value})

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard