web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Save values from Selec...
Power Apps
Suggested Answer

Save values from Select All checkbox to collection and patch it to db

(0) ShareShare
ReportReport
Posted on by 52
I have a Select All option in a container along with check boxes where some locations are present. I have to choose all the checkboxes and save it in SQL using patch function. I was able to do save the single selection of check boxes and patch it to sql. But I have placed the Select All check box outside the gallery that has locations so Iam unable to use Thisitem.marketing_location.
For single select I use the following code
in Oncheck property to create collection colinput- 
Collect(colinput,{region_c:Gallery5.Selected.Value,market_c:ThisItem.Marketing_Location})
Patch function used is -
ForAll(colinput,
Patch(data_source,Defaults(data_source),{region:region_c,market_location:market_c,submitted_by:User().Email,submitted_time:Now(),status:"New"}));Clear(colinput);
 
The left side region gallery is gallery5. and the right side gallery6. 
How to save the values from all check boxes into a collection and patch it to sql? 
 
Categories:
I have the same question (0)
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
     
    You can do this using the following steps.
    For the Default property of all your Location CheckBoxes:
    If(SelectAllCheckBox.Value = true, true, false)
    This will give you the following behavior in your app:
    OnSelect property of each Item:
    Reset(SelectAllCheckBox)
    OnCheck Property of SelectAllCheckBox:
    ClearCollect(
        colinput,
        {
            region_c: Gallery5.Selected.Value,
            market_c: Concat(
                Gallery6.AllItems,
                Value,
                ", "
            )
        }
    )
    This will create a collection like this:
     
    OnCheck property of the Items remains the same:
    Collect(colinput,
           {region_c:Gallery5.Selected.Value,
            market_c:ThisItem.Marketing_Location})
    
     
    Your Patch function will remain the same.
     
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     
  • Suggested answer
    CA1105 Profile Picture
    545 Moderator on at
    User below to check all the checkboxes
    If(SelectAllCheckBox.Value, true, false)
     

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 250 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 211 Super User 2026 Season 1

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard