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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Keeping Item Selected ...
Power Apps
Answered

Keeping Item Selected Properties

(0) ShareShare
ReportReport
Posted on by 38

I have two galleries that referencing two collections.  Both of these collections use the same source, with one collection containing projects that have all statuses to include cancel, complete, active and pending.  The other collection displays only active and pending projects.  The different galleries are displayed based on someone selecting a button to display either all projects or only active projects.  


The issue I am running into is that I have a template fill property that changes colors based on you selecting the gallery item.  What I would like to do is if a user selects an item and it changes colors, if they select the button, the item that was selected in the one gallery, if it exists in the other gallery, change the template fill color on that gallery, so it looks as if they are looking at the same gallery.  

 

Is this possible?

 

Completed Project Gallery - As you can see the button at the top shows "Show Only Active" and the project is highlighted "Green".

pb37087_0-1645208042212.png

 

Active Project Gallery - As you can see the button at the top shows "Show All Projects" and the project exists in this gallery, but is not highlighted.

pb37087_1-1645208104459.png

 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @pb37087 

    Sure, just set the TemplateFill in the second gallery based on your first one.

    Ex.

       If(ThisItem.ProjectName= FirstGalleryName.Selected.ProjectName, Green, Transparent)

     

    I hope this is helpful for you.

  • pb37087 Profile Picture
    38 on at

    @RandyHayes That worked really well.  Now the only problem I am having is that if the other item is selected in the one gallery, and I click the button, I now have two items with that same color because it is selected in the other gallery.  

     

    This is my code.  Any idea how to deselect the other gallery based on a selection in the new gallery.

     

    If(ThisItem.ProjectName = gal_AllProjects.Selected.ProjectName, RGBA(0, 240, 132, 1), ThisItem.IsSelected, RGBA(0, 240, 132, 1), RGBA(0, 0, 0, 0))

     

    pb37087_0-1645213021589.png

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @pb37087 

    Wel your formula is stating that if the gallery project name matches what was selected in gal_Allprojects, then make it green, otherwise, if it is selected, make it green.

     

    So the Selection and the condition are two different things.  Every gallery has a Selected Item which is the record that is selected.  In your case, your are wanting your color to change (simulating a selection) in the second gallery, so using the .IsSelected should not be used.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard