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 / Conditional fill backg...
Power Apps
Answered

Conditional fill background on choice selection

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

Hello,

 

I am trying to set a background colour on either the entire row or the choice or just the choice selection but neither are working with the below code - any pointers to what I'm doing wrong?

sudosaurus_0-1641812986023.png

 

If(
DataCardValue19.Selected.Value = "ANo! Product deemed to high a hazard! Use alternative product or method.",
Red,
DataCardValue19.Selected.Value = "Yes, Follow this COSHH assessment.",
Green,
White
)
Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,876 Most Valuable Professional on at

    Hi @sudosaurus,

     

    I think you have some small typos in your formula.

     

    The first text begins with an A. And the second option ends with a dot. The text of your choice options looks different.

     

    Can you try below and see if that works?

     

    If(
    DataCardValue19.Selected.Value = "No! Product deemed to high a hazard! Use alternative product or method.",
    Red,
    DataCardValue19.Selected.Value = "Yes, Follow this COSHH assessment",
    Green,
    White
    )

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Thanks @Expiscornovus 

     

    Yes I noticed the typo with the "A" at the beginning. However then realised that I had put a "." at the end of one of my choice values in SP list. Which is likely why the formula wasnt working. 

    Works great now thanks! 😄

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 May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard