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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch color value in P...
Power Apps
Answered

Patch color value in PowerApps

(0) ShareShare
ReportReport
Posted on by 74

Heyy,

        Can someone help me with below ?

I am trying to patch color value i.e RGBA value to my Sql server database but getting error : Invalid Argument type (color) Expecting text values instead. Please help me understand

 

DB Column type : nvarchar(50) .. Please let me know if I need to change here.

 

Thanks in Advance

Manoj 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @kullurumanoj 

    RGBA returns a color value, not a text string.  You will not be able to store that value as it is a color type.  I'm not sure there is an equivalent for it in SQL. 

    You could store the individual colors in their own fields, or you can store the hex equivalent in the text field and then use the ColorValue function to convert it back to a color.

     

    I hope this is helpful for you.

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @kullurumanoj ,

    Do you want to save the RGBA Color value into your SQL Table from your app?

     

    I agree with @RandyHayes 's thought almost. The RGBA() function returns a color value based on Red, Green, and Blue color components rather than a Text String value.

    Currently, within SQL table, there is no column type supported to store the RGBA color value.

     

    As an alternative solution, you could consider create three separated Text type columns (e.g. nvarchar(50) type ) to store the Red color component value, Green color component value and Blue color component value individually. When you want to display the RGBA color value within your app based on the three component values from your SQL Table, please take a try with the following formula:

    RGBA(
     ColorValue(RedColumn), /* <-- RedColumn used to store the Red color component value */
     ColorValue(GreenColumn), /* <-- GreenColumn used to store the Green color component value */
     ColorValue(BlueColumn), /* <-- BlueColumn used to store the Blue color component value */
     1
    )

    More details about RGBA function and ColorValue function, please check the following article:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-colors

     

    Best regards,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard