cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kesh
Advocate III
Advocate III

is it possible to unselect a gallery item without using a third party variable

Hi, I have a gallery filtering depending a drop down.

The onselect of the gallery make calculation and when the dropdown is changed, the first item is selected but the calculation is not changing.

 

is it possible to unselect a gallery item without using a third party variable?

1 ACCEPTED SOLUTION

Accepted Solutions
GarethPrisk
Resident Rockstar
Resident Rockstar

The short answer is no. You will need to use variables to effectively track/show the selected item.

Galleries with rows > 0, will have an Item selected. There is no way to un-select all items in the Gallery. However, it is in important to note the difference between a user-input (Select) vs. an item being selected by default.

 

The OnSelect property and Select function are both based on user input. To be clear, the Select function can act as though the user has clicked/selected the specified control but it itself is typically predicated an another user input. You can invoke it indirectly (think OnVisible of a screen, or when the app loads), but it's usually user-based.

 

The filtering of the gallery is based on the dropdown's value. When it changes, the Gallery's Items are changing. However, the Gallery's ThisItem.IsSelected is contextual to the row, and will shift if that record is no longer visible. This does not trigger the OnSelect function of the Gallery.

 

You can observe this behavior by

  1. Adding a vertical Gallery from a template
  2. Add a Combo Box control
  3. Set the Items on the Gallery to be Filter(CustomGallerySample,SampleHeading in ComboBox1.SelectedItems.SampleHeading)
  4. Set the Items on the Combo Box to be CustomGallerySample
  5. Update any of the labels in the Gallery to be ThisItem.IsSelected

See what happens to that label as you add/remove things with the Combo Box.

View solution in original post

1 REPLY 1
GarethPrisk
Resident Rockstar
Resident Rockstar

The short answer is no. You will need to use variables to effectively track/show the selected item.

Galleries with rows > 0, will have an Item selected. There is no way to un-select all items in the Gallery. However, it is in important to note the difference between a user-input (Select) vs. an item being selected by default.

 

The OnSelect property and Select function are both based on user input. To be clear, the Select function can act as though the user has clicked/selected the specified control but it itself is typically predicated an another user input. You can invoke it indirectly (think OnVisible of a screen, or when the app loads), but it's usually user-based.

 

The filtering of the gallery is based on the dropdown's value. When it changes, the Gallery's Items are changing. However, the Gallery's ThisItem.IsSelected is contextual to the row, and will shift if that record is no longer visible. This does not trigger the OnSelect function of the Gallery.

 

You can observe this behavior by

  1. Adding a vertical Gallery from a template
  2. Add a Combo Box control
  3. Set the Items on the Gallery to be Filter(CustomGallerySample,SampleHeading in ComboBox1.SelectedItems.SampleHeading)
  4. Set the Items on the Combo Box to be CustomGallerySample
  5. Update any of the labels in the Gallery to be ThisItem.IsSelected

See what happens to that label as you add/remove things with the Combo Box.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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