Skip to main content
Community site session details

Community site session details

Session Id : O6tdoVAlgtbuxTTsbXw55X
Power Apps - Building Power Apps
Answered

Model driven command bar - update all records selected

Like (1) ShareShare
ReportReport
Posted on 7 Dec 2023 15:59:07 by

Hi everyone,

 

I have a subrid with records. I want to select records, and press a button so the records are updated.

This is my code:

 

Patch('Training Subscriptions';
ForAll(Self.Selected.AllItems;
{
TriggerFlowResult:true;
Result:true}
))
 
But when I press my button, my records are duplicated instead of updated.
I tried lot of things, but nothing worked, ie : open & refresh component library, inverse Patch & ForAll places...
 
Any ideas?
Categories:
  • ProFe Profile Picture
    on 08 Dec 2023 at 08:42:33
    Re: Model driven command bar - update all records selected

    Great, I get it now.

    I managed to make it work with this formula :

     

    Patch('Training Subscriptions';ForAll(Self.Selected.AllItems;
    {
    'Training Subscription': ThisRecord.'Training Subscription'; // this line was missing
    TriggerFlowResult:true;
    Result:true
    }
    ))
     
    Thank you all for your help !
  • Verified answer
    Jonathan Manrique Profile Picture
    2,682 on 08 Dec 2023 at 08:21:57
    Re: Model driven command bar - update all records selected

    Hi @ProFe 

     

    The issue is that you are telling it to make a patch of elements and if you don't tell it which one the default one is creating,

    The first thing you should do is go through each element to make the patch and you can do this using the lookup function and that way you will be telling it that that element is going to be updated.

    If memory serves it would be Patch(tables,ForAll(elements;lookup,{
    TriggerFlowResult:true;
    Result:true}
    ))

    If not the other way around first ForAll(Patch(Lookup

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    You can accept more than one post as a solution

  • ProFe Profile Picture
    on 08 Dec 2023 at 07:53:01
    Re: Model driven command bar - update all records selected

    Thank you for your answer, but when I try this I encounter an error

    Capture d'écran 2023-12-08 085147.png

    This is due to .AllItems, I tried Self.Selected.Item but in this case I only patch the first selected record.

  • SBax Profile Picture
    1,348 on 07 Dec 2023 at 18:20:26
    Re: Model driven command bar - update all records selected

    You don't need the for all, as self.selected.items is a collection

     

    Try

     

    Patch('

    Training Subscriptions',

    Self.Selected.AllItems,

    {

    TriggerFlowResult:true;

    Result:true

    }

    )

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2