cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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?

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Level 10

Re: Highlight gallery item based on another selection

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

View solution in original post

14 REPLIES 14

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.

Highlighted
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.

 

Avgi_Theodorou
Level: Powered On

Re: Highlight gallery item based on another selection

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.

eka24
Level 10

Re: Highlight gallery item based on another selection

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

Re: Highlight gallery item based on another selection

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.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,270)