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

@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
Super User III
Super User III

@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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (13,074)