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

Colorcode rows based on cell values

My gallery has employee names and their correspoding details

Employee Name Col2 col3 col3...

There will multiple rows for each employee.

New employees can be added to gallery 

Existing employees can be deleted from the gallery.

At all times all rows must carry on one color for 1 employee.

Ex:

Emp1 col 1  col 2 col 3 - Red

Emp1 col 1  col 2 col 3 - Red

Emp1 col 1  col 2 col 3 - Red

Emp2 col 1  col 2 col 3 - blue

Emp2 col 1  col 2 col 3 - blue

Emp3 col 1  col 2 col 3 - green

Emp3 col 1  col 2 col 3 - green

Emp3 col 1  col 2 col 3 - green

Emp3 col 1  col 2 col 3 - green

If a new employee is added to the gallery they must be given a different color - violet

How can this be achieved.

thanks

 

2 REPLIES 2
eka24
Level 10

Re: Colorcode rows based on cell values

1. set up a color table or a Collection (AllMyColors)

2. ClearCollect all colors that have already been used (eg: ColorsUsed)

3. use Lookup for colors that has not been used

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

 

Dual Super User
Dual Super User

Re: Colorcode rows based on cell values

Hi @MKR17 

 

You can achieve the configuration by using the below configuration:
 
App - OnStart -> ClearCollect(ColorCodesCollection, {Employee:"Emp1",ColorCode:Color.Red}, {Employee:"Emp2",ColorCode:Color.Blue}, {Employee:"Emp3",ColorCode:Color.Green})
 
Now, on the gallery control, you can set the "TemplateFill" property as:
If(ThisItem.Name in ColorCodesCollection.Employee,LookUp(ColorCodesCollection, Employee = ThisItem.Name).ColorCode,RGBA(0, 0, 0, 0))
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

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

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