cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Avgi_Theodorou
Level: Powered On

Highlight gallery item based on another selection

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?

6 REPLIES 6

Re: Highlight gallery item based on another selection

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
Level: Powered On

Re: Highlight gallery item based on another selection

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
Level 10

Re: Highlight gallery item based on another selection

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
Level: Powered On

Re: Highlight gallery item based on another selection

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

WarrenBelz
Level 8

Re: Highlight gallery item based on another selection

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
Level 10

Re: Highlight gallery item based on another selection

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.

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,331)