cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Commander
Kudo Commander

Generate color value based on GUID

Hi,

 

I would like to generate a color (e.g. #4286f4)  based on a GUID column.
All records with the same GUID will have the same color. All records with different GUID will have different colors.
Can anyone think of a way to do this?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Kudo Commander
Kudo Commander

Re: Generate color value based on GUID

Ok, So I figured it out. 


Say you want to set the color of an iteam in a galery based on the GUID. You can simply use the following:

ColorValue("#"& Left(ThisItem.GUIDColumn,6))

View solution in original post

3 REPLIES 3
Highlighted
Kudo Commander
Kudo Commander

Re: Generate color value based on GUID

Ok, So I figured it out. 


Say you want to set the color of an iteam in a galery based on the GUID. You can simply use the following:

ColorValue("#"& Left(ThisItem.GUIDColumn,6))

View solution in original post

Highlighted
Power Apps
Power Apps

Re: Generate color value based on GUID

Thanks for sharing your solution @AnthonyPhan.

I'll add one more thing--if the column type is not exactly a string, you may need to coerce it to a string before using Left:

ColorValue("#"& Left(Text(ThisItem.GUIDColumn),6))
Highlighted
Power Apps
Power Apps

Re: Generate color value based on GUID

Thanks for sharing your solution @AnthonyPhan.

I'll add one more thing--if the column type is not exactly a string, you may need to coerce it to a string before using left:

ColorValue("#"& Left(Text(ThisItem.GUIDColumn),6))

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (8,075)