cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sudosaurus
Post Prodigy
Post Prodigy

Conditional fill background on choice selection

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
)
1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

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
)

 

View solution in original post

2 REPLIES 2
Expiscornovus
Dual Super User
Dual Super User

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
Post Prodigy
Post Prodigy

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

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,703)