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

Notifications

Announcements

Community site session details

Community site session details

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

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 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard