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 / Highlight gallery item...
Power Apps
Answered

Highlight gallery item based on another selection

(0) ShareShare
ReportReport
Posted on by 39

Hello All. 

 

I have two galleries. The first gallery shows the "Customers" and the other gallery shows the "Visits" of all customers grouped by date.

I created collections for the above, in order to filter the data better. So, i have in fact two collections (Customers & Visits).

I would like help on how to implement the below:

 

-Each time a customer is selected on gallery 1 --> highlight the entries in gallery 2 for the specific customer 

 

Does anyone know how i can achieve this?

Categories:
  • KennethNicasens Profile Picture
    on at

    Hello,

     

    In your 2nd gallery, you can put an indicator ( template color, a box that will be colored,...) with the following formula:

    If(ThisItem.Customer = galleryCustomer.Selected, RGBA(0,0,0,1),RGBA(1,1,1,1))

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Avgi_Theodorou Profile Picture
    39 on at

    I'm i doing something wrong? 

    i added a button on gallery1 -> on select -> Set(SelectedCustomerID, ThisItem.Title1); Set(FillVar, true);

     

    on template fill of gallery2 -> If(FillVar, If(ThisItem.CustomerID = SelectedCustomerID, BlueViolet, White), White) & i also tried  If(ThisItem.CustomerID = SelectedCustomerID, BlueViolet, White)

     

    I also tried on gallery2 label fill property --> If(ThisItem.CustomerID = SelectedCustomerID, BlueViolet, White)

     

    and it doesnt work.

  • eka24 Profile Picture
    20,925 on at

    Try the following:

    1. Use the Customer for the first Gallery1

    2. Filter Visit the Gallery2: Filter(Gallery2,ID=Gallery1.Selected.ID

    3. Then the TemplateFill property: If(ThisItem.Selected,Blue,Red)

  • Avgi_Theodorou Profile Picture
    39 on at

    I didnt want to filter the second gallery based on the selection of the first gallery, because i wanted to view it like a calendar and view all the visits for all customers(visits are grouped by date) . Because the second gallery is in vertical view, it's easier on the eye if the colors are changing instead of scrolling to find the items. 

    I really dont get why it's not working - check the attachments

    Screen Shot 2020-02-14 at 11.18.27 AM.png
    Screen Shot 2020-02-14 at 11.18.37 AM.png
    Screen Shot 2020-02-14 at 11.19.51 AM.png
  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Avgi_Theodorou ,

    A few of us have had a go at this, so I will throw my 20c worth in.

    From what I can see of your requirements, you simply need all items for the customer in Gallery two highlighted when a record for the customer is selected in Gallery 1. Try this in the TemplateFill of Gallery2

    // Use your gallery name
    If(
     ThisItem.Customer = Gallery1.Selected.Customer,
     BlueViolet,
     White
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • eka24 Profile Picture
    20,925 on at

    Have tested it worked:

    1. Select Gallery1 (Customer Gallery) and OnSelect of the Gallery, put this variable:

     Set(MyID,ThisItem.CustomerID)

    2. Select Gallery2. On the TemplateFill of the Gallery2 put this code:

    If(ThisItem.CustomerID=MyID,Green,White)
    Check the attachment
     

    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

     

    Gal2.JPG
    Gal1.JPG
  • Avgi_Theodorou Profile Picture
    39 on at

    I tried it but it doesnt work. Please check the attachments. i also tried adding on the second gallery a collection instead of a sharepoint list, but again something goes wrong.

    Screen Shot 2020-02-17 at 1.27.58 PM.png
    Screen Shot 2020-02-17 at 1.23.13 PM.png
  • eka24 Profile Picture
    20,925 on at
    Please follow the post I did. The first screenshot shows you didn't follow it. Two main formulas :
    Set(MyID,ThisItem.CustomerID)
    and
    If(ThisItem.CustomerID=MyID,Green,White)
    The attached clearly shows how to go about it.
    You can copy and Paste your two formulas, on first and last second Galleries for correction.
    Thank you
  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Avgi_Theodorou ,

    Both @eka24 and myself are heading in the same  direction - he is very good at this and I will leave you in his capable hands.

  • Verified answer
    eka24 Profile Picture
    20,925 on at
    1. Select Gallery1 (Customer Gallery) and OnSelect of the Gallery, put this variable:
    Set(MyID,ThisItem.CustomerID)
    Please dont select an item in the gallery but the gallery itself.
    2. Select Gallery2 Where you want the highlight) . On the TemplateFill of the Gallery2 put this code:
    If(ThisItem.CustomerID=MyID,Green,White)
    MyID here refers to the variable

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 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard