cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
turnbeNZ
Frequent Visitor

Change the fill colour of a gallery item from Sharepoint

Hi

 

This seems like it should be relatively simple, but after spending an hour searching, here I am.

 

I have a SharePoint list (Eden-Drink) with columns "DrinkItem" and "Colour" these are both text fields and are connected to a gallery in the powerapp.

 

In the gallery I have a circle item that I want to change the fill to be the value of the RGBA set in the respective colour column

 

e.g. If I have the DrinkItem of "Orange Juice" then I want the circle to change to the RGBA value in the column "Colour" in this case which is "255, 191, 0, 1"

 

I cant seem to get this to work, Every combination of using Lookup on the item fill property doesn't work. and if I try to just set the fill property to ThisItem.Colour that doesnt work either.

 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@turnbeNZ 
You will want to store Hex Color values in your SharePoint instead of RGBA values.

 

Why?  The RGBA function must be supplied with 4 arguments from 4 different SharePoint columns.  Hex color values can be stored in 1 column and therefore will be more performant.  A much better choice in my opinion.

 

Use this RGBA to Hex converter to find the values: https://www.hexcolortool.com/

RGBA(255,191,0,1) -> #ffbf00

 

Now you can simply use the COLORVALUE function inside the TemplateFill property of the gallery to make each item the proper colour.

ColorValue(ThisItem.Colour)

 

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

 

View solution in original post

1 REPLY 1
mdevaney
Super User
Super User

@turnbeNZ 
You will want to store Hex Color values in your SharePoint instead of RGBA values.

 

Why?  The RGBA function must be supplied with 4 arguments from 4 different SharePoint columns.  Hex color values can be stored in 1 column and therefore will be more performant.  A much better choice in my opinion.

 

Use this RGBA to Hex converter to find the values: https://www.hexcolortool.com/

RGBA(255,191,0,1) -> #ffbf00

 

Now you can simply use the COLORVALUE function inside the TemplateFill property of the gallery to make each item the proper colour.

ColorValue(ThisItem.Colour)

 

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

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,655)