Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Conditional fill background on choice selection

(0) ShareShare
ReportReport
Posted on by 1,597 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
)
  • sudosaurus Profile Picture
    1,597 Super User 2024 Season 1 on at
    Re: Conditional fill background on choice selection

    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! 😄

  • Verified answer
    Expiscornovus Profile Picture
    31,641 Most Valuable Professional on at
    Re: Conditional fill background on choice selection

    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
    )

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard