Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Checkbox on BrowseGallery, How to Change field value based on check

(0) ShareShare
ReportReport
Posted on by 909 Super User 2024 Season 1

Hi,

 

I have a checkbox like so  in my browsegallery - 

wonka1234_0-1693320725148.png

I want to change my status field on check. 

 

I have this in my OnCheck property - 

 

Set(statusupdate,"Complete"); SubmitForm(EditForm1);

 

however nothing is happening. How can I change my status based on check property for each record in my browwsegallery?

 

 

wonka1234_2-1693320891146.png

 

 

  • Pstork1 Profile Picture
    65,946 Most Valuable Professional on at
    Re: Checkbox on BrowseGallery, How to Change field value based on check

    I think it should be something more like this

    Patch(['Data Source'], ThisItem, {updateStatus: {Value = "Complete"}})

    assuming the column name is updatestatus.

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on at
    Re: Checkbox on BrowseGallery, How to Change field value based on check

    Trying this for patch

    Patch(['Data Source'], ThisItem.Status_two.Value, Status_two.Value = "Complete")

     

    also trying this -

     

    Patch(['Data Source'], ThisItem.Status_two , {Status_two:Complete})

     

    where am I going wrong?

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on at
    Re: Checkbox on BrowseGallery, How to Change field value based on check

    okay  just need help with why we are setting default property to this if statement.

    what is this doing? 

  • Pstork1 Profile Picture
    65,946 Most Valuable Professional on at
    Re: Checkbox on BrowseGallery, How to Change field value based on check

    Use an IF() statement in the Default property of the checkbox to set the value of each item when you load the gallery.  If you want to save the value when the checkbox is checked or unchecked Set an appropriate Patch() statement in the OnCheck and OnUncheck properties.  the if statement would be something like

    if(thisItem.statusupdate.Value = "Complete",true,false)
  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on at
    Re: Checkbox on BrowseGallery, How to Change field value based on check

    @Pstork1  thank you.

     

    Which property do you mean as "Checkbox value" is that default or oncheck? -

     

    What I have so far - 

     

    OnCheck = Set(gblRecordID, ThisItem.ID)    

     

    How should the if statement be setup? 

     

     

     

  • Pstork1 Profile Picture
    65,946 Most Valuable Professional on at
    Re: Checkbox on BrowseGallery, How to Change field value based on check

    Add the Checkbox to the Gallery Template (the first record in the gallery that you edit with the pencil icon). Then bind that Checkbox to the value of ThisItem.statusupdate as the default.  You'll need to use an IF statement to set the checked property when the gallery loads and then use a Patch to save it since you are editing a Gallery and not a Form so there is no SubmitForm()

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard