Skip to main content
Community site session details

Community site session details

Session Id : 5Rw3mH0qN+CvInJMMS5PnF
Power Apps - Building Power Apps
Unanswered

Patch records from collection into choice field with button click

Like (0) ShareShare
ReportReport
Posted on 16 Nov 2022 14:50:37 by 18

Hello,

I'm unable to find a solution for this specific example.

Goal: User selects one or more records from a gallery using checkboxes and is routed to a screen to perform different actions. One action is to simply click a button and the choice field for all associated records is set to "Returned".

 

Return Button:

Patch('Main Data',ForAll(Collect_List1,{Status: "Returned"}));
Clear(Collect_List1);
Back()

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on 17 Nov 2022 at 09:22:21
    Re: Patch records from collection into choice field with button click

    ForAll(Collect_List1,

    Patch(

    'Main Data',

    Defaults('Main Data')

    ,{Status: {Value: {"Returned"}}

    )

    );
    Clear(Collect_List1);
    Back()

  • GAM1741 Profile Picture
    18 on 16 Nov 2022 at 17:57:58
    Re: Patch records from collection into choice field with button click

    I'm receiving error: The type of this 'Status' does not match the expected type 'Record'. Found type 'Text'.

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on 16 Nov 2022 at 17:54:00
    Re: Patch records from collection into choice field with button click

    Nogueira1306_0-1668621203907.png

    ForAll(Collect_List1,

    Patch(

    'Main Data',

    Defaults('Main Data')

    ,{Status: "Returned"}

    )

    );
    Clear(Collect_List1);
    Back()

  • GAM1741 Profile Picture
    18 on 16 Nov 2022 at 17:52:13
    Re: Patch records from collection into choice field with button click

    Thanks for the response. I added the update function but still can't seem to make it work. I'm new to Power Apps and sure I'm missing something simple. 

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on 16 Nov 2022 at 15:14:06
    Re: Patch records from collection into choice field with button click

    ForAll(Collect_List1,

    Patch(

    'Main Data',

     

    //YOU NEED TO INSERT HERE IT IS NEW OR UPADTE

     

    ,{Status: "Returned"}

    )

    );
    Clear(Collect_List1);
    Back()

     

     

    That formula should work for you. You just need to say if it is a new record if you are updating a record

     

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

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    My website!

    My blog!

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

Loading started