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 / Unexpected behavior - ...
Power Apps
Answered

Unexpected behavior - checkbox resets when icon is selected

(0) ShareShare
ReportReport
Posted on by 87

Hello all,

 

I have a gallery for managers to approve the invoices. The approval is done by selecting the thumbs up/thumb down icon.

Afterwards they need to select the gallery items for which they want to send the updates via checkbox (and then clicking on some button which is now not relevant).

 

My issue is that when I first select the checkbox and then change the thumbs selection, the checkbox resets to unchecked.

Could you please advise what am I doing wrong?

 

Below is the screenshot and some properties which might be relevant.

 

Gallery checkbox properties

OnCheck: true

OnUncheck: false

OnSelect: false

Default: Switch(locSelectAll, "t", true, "f", false, false)

Reset: false

 

Default is set as above in order to use "Select all" checkbox which is outside of gallery.

MalyMajo_0-1670346367106.png

 

Categories:
I have the same question (0)
  • Verified answer
    Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at

    @MalyMajo 

     

    when you  'change the thumbs selection', does it do patching to the same datasource as your gallery.items refers to?

    If yes, i would add a button outside the gallery and move patching code there using ForAll().
    PS. this will work only if the gallery is not inside a form.

  • MalyMajo Profile Picture
    87 on at

    @Alex_10 you were right, thanks a lot! 🙂


    Due to that I had to rework whole logic on the like/dislike buttons but it seems to work.
    For those who will face similar issue, I will post some code below.

     

    OnSelect property of ThumbsUp icon

    // set parameters
    UpdateContext({locEditedItem: ThisItem});
    UpdateContext(
     {
     locLookedUpItem: LookUp(
     colPendingApprovals,
     recordID = locEditedItem.ID
     )
     }
    );
    // if the approval status is blank or false, set it to true. else set it to blank
    UpdateContext(
     {
     locApprovalStatus: If(
     Or(
     IsBlank(locLookedUpItem.approvalStatus),
     !locLookedUpItem.approvalStatus
     ),
     true,
     Blank()
     )
     }
    );
    // if the record is not in collection of changes, add it there. else update existing record
    If(
     IsBlank (
     LookUp (
     colPendingApprovals,
     recordID = locEditedItem.ID
     ).recordID
     ),
     Collect (
     colPendingApprovals,
     {
     recordID: locEditedItem.ID,
     approvalStatus: locApprovalStatus
     }
     ),
     Patch (
     colPendingApprovals,
     LookUp (
     colPendingApprovals,
     recordID = locEditedItem.ID
     ),
     {
     recordID: locEditedItem.ID,
     approvalStatus: locApprovalStatus
     }
     )
    )

     

    Icon property of ThumbsUp icon

    If(
     Or(
     IsBlank(
     LookUp(
     colPendingApprovals,
     recordID = ThisItem.ID
     ).approvalStatus
     ),
     !LookUp(
     colPendingApprovals,
     recordID = ThisItem.ID
     ).approvalStatus
     ),
     ThumbsUp,
     ThumbsUpFilled
    )

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
Valantis Profile Picture

Valantis 604

#3
11manish Profile Picture

11manish 518

Last 30 days Overall leaderboard