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

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

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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,035)