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 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,747 Moderator 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 385

#2
Vish WR Profile Picture

Vish WR 367

#3
timl Profile Picture

timl 340 Super User 2026 Season 1

Last 30 days Overall leaderboard