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 / Checkbox within Galler...
Power Apps
Unanswered

Checkbox within Gallery OnCheck and OnUncheck not functioning as expected

(0) ShareShare
ReportReport
Posted on by 2

Hi,

 

I have gallery with a collection as a datasource. The gallery has checkbox which is based on collection column value.

I have following logic on Checkbox Default data, OnCheck and OnUncheck actions - 

 

Default:

If(ThisItem.Column1 = "Complete",true,false)
 
OnCheck:
Patch(colTest,ThisItem,{Column1: "No"})
 
OnUncheck:
Patch(colTest,ThisItem,{Column1: "Yes"})

 

The behavior from this is unexpected. When I uncheck the checkbox, the value is updated in the collection, and checkbox unchecks, however when the checkbox is checked again, the value in the collection is updated, the Checkbox.Value is true but the check mark is not visible on the checkbox until I click the checkbox again. 

 

Mostly likely I am not using this correctly, any suggestion regarding this would be very helpful.

 

Thanks

Categories:
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    What kind of column is Column1?  Your If statement implies its a text field since you are comparing the column to complete.  But your check and uncheck set the value to "Yes" or "No".  So by definition it won't equal complete so it won't be checked automatically.  Did you mean to use two different columns?  If not then your onCheck should set the value to "Complete".

  • vtoshniwal Profile Picture
    2 on at

    Thanks for your response. Actually, please see revised logic below:

     

    Default:

    If(ThisItem.Column1 = "Complete",true,false)
     
    OnCheck:
    Patch(colTest,ThisItem,{Column2: "No"})
     
    OnUncheck:
    Patch(colTest,ThisItem,{Column2: "Yes"})
     
    The checkbox check/uncheck is based on value of Column1 for that item in the gallery to show the app user whether a task/activity is masked complete or not. And if the app user changes that checkbox, I want another Column - Column2 to change inside the collection to know if that item has been modified or not - which I can then filter out to see what items needs to be synced as well as shown to user as changed.
     
    Just not sure why would a checkbox not show checked even though the checkbox.value is changing to true?
     
    Thanks again.

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard