cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kesh
Helper III
Helper 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
Super User II
Super User II

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

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

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 Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (61,948)