cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lolla70
Helper IV
Helper IV

Label Text with Formula

Hello

 

I created a Label and 
Set(varResult, "Well-check Status Required");

 

Then on the Label I have If Statement

Text : 

If(ListBox3.Selected.Value = "Yes", "No Work",
ListBox3.Selected.Value = "No", "Work")

 

Fill:

If(ListBox3.Selected.Value = "Yes", Yellow,
ListBox4.Selected.Value = "No", LightGreen)

 

My question is how I add my varResult to the Text and Fill? When I do this, it is giving me error.

 

Text : 

varResult,

If(ListBox3.Selected.Value = "Yes", "No Work",
ListBox3.Selected.Value = "No", "Work")

 

I want the lblResult to start with "Well-check Status Required" and If they select ListBox3 the text change to "No Work"

 

1 ACCEPTED SOLUTION

Accepted Solutions

Change the formula to:

Text:

If(IsBlank(ListBox3.Selected.Value),"Well-check Status Required",

"Well-check Status Required"&" "&If(ListBox3.Selected.Value = "Yes", "No Work",
ListBox3.Selected.Value = "No", "Work"))
 
 

Fill

If(IsBlank(ListBox3.Selected.Value) Or ListBox3.Selected.Value = "Yes", Yellow,
ListBox3.Selected.Value = "No", LightGreen)
 
OR
If(IsBlank(ListBox3.Selected.Value),Yellow,
If(ListBox3.Selected.Value = "Yes", Yellow,
ListBox3.Selected.Value = "No", LightGreen))
------------

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

7 REPLIES 7
eka24
Super User
Super User

Try this:

varResult&" "&

If(ListBox3.Selected.Value = "Yes", "No Work",

ListBox3.Selected.Value = "No", "Work")

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

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.

Thank you so much, I tried it and it works the first time then it is giving me a black color. I added on Fill and it didn't work

 

If(
varResult = "Well-check Status Required",
Yellow
)

If(ListBox3.Selected.Value = "Yes", Yellow,
ListBox4.Selected.Value = "No", LightGreen)

Please did you say it did not work for both the Text and the Color or it worked for Text Only?

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

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.

Text

varResult&" "&If(ListBox3.Selected.Value = "Yes", "No Work",
ListBox3.Selected.Value = "No", "Work")

 

Fill

If(ListBox3.Selected.Value = "Yes", Yellow,
ListBox3.Selected.Value = "No", LightGreen)listbox.JPG
 
listbox2.JPG
 
 
------------

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.
lolla70
Helper IV
Helper IV

I want if there is no selected value the Sentence "Well-check Status Required") Yellow color and if selected to Yes or No, the value then will change based on the Yes, or No and the Yellow or Lightgreen color

 

When I put the text Formula with no selected value the lblResult is Black.

 

Thanks for your help much appreciated!

 

 

Change the formula to:

Text:

If(IsBlank(ListBox3.Selected.Value),"Well-check Status Required",

"Well-check Status Required"&" "&If(ListBox3.Selected.Value = "Yes", "No Work",
ListBox3.Selected.Value = "No", "Work"))
 
 

Fill

If(IsBlank(ListBox3.Selected.Value) Or ListBox3.Selected.Value = "Yes", Yellow,
ListBox3.Selected.Value = "No", LightGreen)
 
OR
If(IsBlank(ListBox3.Selected.Value),Yellow,
If(ListBox3.Selected.Value = "Yes", Yellow,
ListBox3.Selected.Value = "No", LightGreen))
------------

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.

Thank you so much, Just tried it and it worked great. 

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.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,467)