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

Re: Change the fill colour of a gallery item from Sharepoint

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

Re: Change the fill colour of a gallery item from Sharepoint

@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!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (10,480)