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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (79,587)