web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / No selected items in g...
Power Apps
Unanswered

No selected items in gallery

(1) ShareShare
ReportReport
Posted on by 315

I have a screen with a gallery on the left, a display form on the right, and the top I have filter boxes with a search bar.   I have a template fill formula on the gallery that highlights the selected item.  The gallery's OnSelect is set to Set(varRecord, ThisItem.ID) and the display form Item is set to LookUp(DataSource, ID=varRecord).  

 

This setup works, but the highlighted item on the gallery does not always match the displayed item on the display form after doing a filter or a search.  The gallery defaults to the first item and highlights it while the display form shows another item.  This confuses some users.  I came up with a fix for this that does not select any gallery items and hides the display form until an item is select.  This works, but I would like to see if there is a better way to do it.  

 

This is my fix:

1. Set the gallery's Default property to {} so that no items are highlighted/selected.

Default = {}

2. In the gallery, I have a divider that also changes color when the item is selected.  I set the tooltip property to: 

Tooltip = If(ThisItem.IsSelected, "Selected", "Non-Selected")

 3. If the tooltip for the divider is Non-Selected for all items, the display form is hidden:

Visible = If(Gallery.Selected.Divider.Tooltip = "Selected", true, false)

  

The reason for using the tooltip for the divider is because I could not get anything else to work.  I tried to use Gallery.Selected.Divider.Fill for the display form's visible property so that I could link it to the color of the divider, but Fill is not an option.  The options are limited to AccessibleLabel, ContentLanguage, and Tooltip.

 

Like I said earlier, this setup that I have does work the way I want it to, but I would like to see if there is another way that makes more sense.  

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @Alex-W - do you really need a global variable on the Form if both the Gallery and the Form are on the same screen?

     

    What happens if you change the Item property on the form to: Gallery.Selected or simply varRecord? Does the same inconsistent behaviour happen?

  • Alex-W Profile Picture
    315 on at

    @Amik You provided a method that makes more sense!! 

     

    I do not need the variable.  It's just one of those things that I have become accustom to doing when working with a gallery.  This is one of those times when doing the simple Gallery.Selected actually made things work better.  I ran a few tests and the display form always shows the selected item on the gallery.  I no longer need the formulas from my original post.  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard