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 / 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:
I have the same question (0)
  • Pstork1 Profile Picture
    68,739 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

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard