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 Apps
Answered

Compare problem?

(0) ShareShare
ReportReport
Posted on by 53

I need to chnge fill color depending on slelected value but got error "Incompatible  types for comparison, these types can't be compared: Record, Text"

here is how it looks:

adixx_0-1716208060303.png

 

If(
 DataCardValue9.Selected = "Client", Color.Blue,
 DataCardValue9.Selected = "Printer", Color.Green,
 DataCardValue9.Selected = "BMS", Color.Yellow,
 DataCardValue9.Selected = "Production", Color.Pink,
 DataCardValue9.Selected = "CCTV", Color.Purple
)

 

i tried with switch but no effects 

adixx_1-1716208121868.png

 

Categories:
I have the same question (0)
  • Verified answer
    Rajkumar_M Profile Picture
    3,741 Super User 2025 Season 2 on at

    Hi @adixx 

     

    Try this formula,

     

    Instead of DataCardValue9.Selected change to DataCardValue9.Selected.Value

     

     

    If(
     DataCardValue9.Selected.Value = "Client", Color.Blue,
     DataCardValue9.Selected.Value = "Printer", Color.Green,
     DataCardValue9.Selected.Value = "BMS", Color.Yellow,
     DataCardValue9.Selected.Value = "Production", Color.Pink,
     DataCardValue9.Selected.Value = "CCTV", Color.Purple
    )

     

     

    .Value refers to the combo box item's (DataSource) column name.

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

  • adixx Profile Picture
    53 on at

    it works!!

    thx

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard