cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Channah
Helper III
Helper III

attempting to use fill function to change based on text value

Hi there, 

 

I have a gallery with a number of labels. 

 

I would like the fill colour of these labels to change colour based on the text the label has. 

 

e.g. 

a strip down version of what I am trying to do

label has an option to be yes or no 

I would like yes  = green, no = red. 

 

attempted below with no success

If(Text(label1.Text) = Yes, Green))

 

Thanks

3 ACCEPTED SOLUTIONS

Accepted Solutions
eka24
Super User III
Super User III

Try on the fill or color property of the label

If(label1.Text = "Yes", Green,Red)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Hi @Channah 

For the gallery, I would do it based on the value of the column and not the label itself. Try this: If(ThisItem.ColumnName = "Yes", Green, Red)

Regards,

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

Hi @Channah 

You can do it this way 

If(
   ThisItem.ColumnName = "Yes", Green,
   ThisItem.ColumnName = "No", Red,
   ThisItem.ColumnName = "Pending", Yellow
)
Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

5 REPLIES 5
eka24
Super User III
Super User III

Try on the fill or color property of the label

If(label1.Text = "Yes", Green,Red)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Thank You!!

Hi @Channah 

For the gallery, I would do it based on the value of the column and not the label itself. Try this: If(ThisItem.ColumnName = "Yes", Green, Red)

Regards,

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

Sorry,

 

If I had more than two options. 

 

YES: GREEN

NO: RED

PENDING: YELLOW

How would I include this additional step? 

 

thanks

Hi @Channah 

You can do it this way 

If(
   ThisItem.ColumnName = "Yes", Green,
   ThisItem.ColumnName = "No", Red,
   ThisItem.ColumnName = "Pending", Yellow
)
Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (55,699)