cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Qb00ne
Frequent Visitor

Gallery - Uncheck checkbox for selected item only

Hi guys,

 

I have to galleries. 1st it the main one where I have checkbox option. And the 2nd is gallery with some details of selected item, and here I have X button. I am searching for the way to uncheck (untick) only currently selected item when user click on X button. 

 

Qb00ne_0-1606741171198.png

After click on X

Qb00ne_1-1606741212316.png

 

Thank you in advance!

Best Qb00ne

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Qb00ne 

It's a little tricky because you are trying to alter a control in a gallery. 

Here's how you can go about it.

 

On your X icon, place this formula in the OnSelect:

    UpdateContext({lclUncheck:true})

 

In your Gallery, place a Toggle control (let's call it tglResetCheck).  You can make this control not visible.  

Set the Default property of the Toggle to the following:

    ThisItem.IsSelected && lclUncheck

Set the OnCheck Action of the Toggle to the following:

    UpdateContext({lclUncheck:false})

 

Now, set the Reset property on the Checkbox control in your gallery to the following formula:

    tglResetCheck.Value

 

This should give you what you are looking for.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@Qb00ne 

It's a little tricky because you are trying to alter a control in a gallery. 

Here's how you can go about it.

 

On your X icon, place this formula in the OnSelect:

    UpdateContext({lclUncheck:true})

 

In your Gallery, place a Toggle control (let's call it tglResetCheck).  You can make this control not visible.  

Set the Default property of the Toggle to the following:

    ThisItem.IsSelected && lclUncheck

Set the OnCheck Action of the Toggle to the following:

    UpdateContext({lclUncheck:false})

 

Now, set the Reset property on the Checkbox control in your gallery to the following formula:

    tglResetCheck.Value

 

This should give you what you are looking for.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

dariobois
Resolver II
Resolver II

Hi, 

Is the "checkbox" control binding directly from a item field? in that case, just use the patch function in the "OnSelect" event of the "X" button to update the "boolean" field of the Galery Selected Item.

 

Regards!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,516)