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 III
Super User III

@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 III
Super User III

@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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,635)