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 / Hightlight item select...
Power Apps
Unanswered

Hightlight item selected on gallery

(0) ShareShare
ReportReport
Posted on by 22

Hi community,

 

I am finishing a job selection app and I only need one detail.
Inside a gallery are all the available positions and I already have the way to highlight the selected table but..., by default, a highlighted item always appears and I want it not to be like that and that they are of the same color until the user selects one , any ideas?

 

When I selected a date from Datepicker I can 

This code is on Fill property in text label inside gallery

 

 

 If(ThisItem.IsSelected; RGBA(0; 250; 1; 0,5); RGBA(255; 255; 255; 0,1))

 

 

Thank you all,

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Agalavan27 

    You would use the TemplateFill property of the gallery to highlight the selected item.  You can use a formula similar to the one you have above, but use Transparent for the unselected option. for example:

     If(ThisItem.IsSelected; LightCyan ; Transparent)

     

  • Agalavan27 Profile Picture
    22 on at

    Hi @Drrickryp and thank you for your answer.

     

    My problem is that when I enter the section to select a table, one is highlighted by default, I want them all to appear blank and only one to be highlighted when clicking on it, but I can't do it.

     

    Agalavan27_0-1680157254926.png

     

    On the other hand, I have the selection of tables blocked until a date has been selected. Once a date is chosen, all those positions that have already been reserved will be shown in red. What I want, and for now I can't either, is to be able to show a timed popup with the notice "Choose date first" when clicking on the posts without having selected a date,

     

    Thank you,

  • rswain Profile Picture
    173 on at

    If I understand correctly, you want to disable the default selection of an item in the gallery and have all the items appear with the same color until the user selects one. One way to achieve this is to modify the gallery's Selected property.

    By default, the Selected property of the gallery is set to the first item in the collection. To disable this behavior, you can set the Selected property to a variable that is initialized to -1 (or any other value that is not a valid index in your collection).

    Here's an example of how you can achieve this:

    1. Add a variable to your screen's OnVisible property to initialize it to -1:

     

     

    Set(varSelectedIndex, -1)

     

     

    Modify the Selected property of your gallery to use this variable:

     

    Selected: If(varSelectedIndex >= 0, YourCollection[varSelectedIndex], {YourDefaultValue})

     

     

    If(ThisItem.RecordNumber = varSelectedIndex, RGBA(0, 250, 1, 0.5), RGBA(255, 255, 255, 0.1))

     

    I hope this helps! Let me know if you have any questions.

     

     

  • Agalavan27 Profile Picture
    22 on at

    Hi @rswain,

     

    I did what you say, but the first element of my gallery is still highlighted. Let me tell you that, in my powerapps, the "Selected" property does not exist within the gallery, but there is "Selectable", is it the same?.

     

    Ty

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