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 / Using checkboxes in a ...
Power Apps
Answered

Using checkboxes in a gallery

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have a very basic SharePoint list I am using to keep track of inventory numbers. In the list I have 3 columns, Model, equipment type, and quantity. When I am putting together an order or giving out equipment I would like to be able to just check all of the items and save it. When I save it I would like for all of the items checked to reduce the quantity value by 1. I do not know how to setup the check boxes or the save button at the top. Any help would be appreciated.

 

BasicBen_0-1616498664563.png

 

Categories:
I have the same question (0)
  • mahoneypat Profile Picture
    1,720 on at

    Please see this video that walks through how to do this.

    (3) Select multiple records in a gallery and Patch with the PowerApps ForAll function - YouTube

     

    Regards,

    Pat

  • eka24 Profile Picture
    20,925 on at

    I suggest you insert a button and another check box your screen (Not inside the Gallery)

    Then Option 1 (Save data whenever any of the Checkbox inside the Gallery is checked), put this formula OnCheck of the Checkbox:

    Patch(YourList,ThisItem,{Model: Label1.Text, equipment :Label2.Text, Quantity: Value(Label3.Text)})

     

    Option 2 (Check all or some of the Checkboxes before saving). On the OnSelect of the Button you inserted put:

    ForAll(
     RenameColumns(
     BrowseGallery1.AllItems,
     "ID",
     "NewID"
     ),
     If(
     Checkbox1.Value,
     Patch(
     List,
     LookUp(
     List,
     ID = NewID
     ),
     {
     Model: Label1.Text, 
     equipment :Label2.Text, 
     Quantity: Value(Label3.Text)
     }
     )
     )
    )
    

     

     

    If you want all the checkboxes inside the Gallery checked at once, in the Default property of the Checkbox inside the Gallery, put CheckboxOutside.Value

     

    Where CheckboxOutside is the name of the checkbox inserted

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

     

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

    @BasicBen 

    Yes, this is fairly straightforward.

    Put your checkboxes in the Gallery as you have (let's call them CheckBox1).

    Assuming your Items property of your Gallery is the record for the underlying data that you want to update and that there is a Qty column (let's call it) in your data, then your Save formula would be this:

    Patch(yourDataSource,
     ForAll(
     Filter(yourGallery, CheckBox1.Value) As _item,
     {ID: _item.ID,
     Qty: _item.Qty - 1
     }
     )
    )

     

    I hope this is helpful for you.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 463

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
11manish Profile Picture

11manish 275

Last 30 days Overall leaderboard