web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Store colour's data in...
Power Apps
Unanswered

Store colour's data in Sharepoint list and use it in powerApps

(0) ShareShare
ReportReport
Posted on by 44

Hello, 

 

I am building in my Power Apps app, a system to customize theme for the user who is connected. 

 

The way i do it : 

- I created a Sharepoint List with two columns :

                                                                            - User : populated with the function User().FullName

                                                                            - ColorChosen : populated with the color in RGBA or Hex Value

 

The current problem is, i cannot user this formula if i replace the RGBA section with a variable wich contain the current RGBA value selected by the user) : 

"

Set(ColorSelected;RGBA(24;114;114;1));;
Set(HEXColor;JSON(ColorSelected))
" -> This formula works and display the HEX value
 -----

"

Set(ColorSelected;labelcontainrgba.text);;
Set(HEXColor;JSON(ColorSelected))
" -> This formula doesn't works, it display RGBA and not the HEX value. 
 
My second question : 
On App.OnStart, I have this : 
Set(Recup_Couleur;LookUp(MySPList;Title=User().FullName;ColorChosen));;
 
When I want to use "Recup_Couleur" in Fill property, for example, I got an error message said it's text type. 
 
Thank's for help ;-). 
Categories:
I have the same question (0)
  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Yoann26 ,

     

    For the first question, because the RGBA function returns a color, your first example works. However, since labelcontainrgba.text will always return a text, not a color it will fail. What you need to do is to convert the text to a hex value somehow, but I don't think a single TextInput control is the right choice for that.

     

    Instead try 3 Text Input controls (one for each color) with the TextFormat property set to TextFormat.Number and restrictions to limit the values between 0 and 255. 

     

    Then update you formulas to:

    Set(
     ColorSelected;
     RGBA(
     labelcontainr.text;
     labelcontaing.text;
     labelcontainb.text;
     1 
     )
    );;
    Set(
     HEXColor;
     JSON(ColorSelected)
    )

     

    As for the second question you need to convert the hex text back to a color by using the formula:

     

    Set(
     Recup_Couleur;
     ColorValue(
     LookUp(
     MySPList;
     Title=User().FullName;
     ColorChosen
     )
     )
    );;
  • Yoann26 Profile Picture
    44 on at

    Hello, 

     

    Thank's it works. 

    Just the last problem is my label wich contains the hex values has " before and after the value, how to remove this please (I have this "#ad3aa1ff" -> I want this #ad3aa1ff) ? 

  • Verified answer
    Yoann26 Profile Picture
    44 on at

    I found the solution : 

     

    Set(HEXColor;Left(HEXColor;Len(HEXColor)-1));; -> remove the last caracter
    Set(HEXColor;Right(HEXColor;Len(HEXColor)-1)) -> remove the first caracter 
     
    Again thank's for the help 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard