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 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
mdevaney
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,207)