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

List Box code result! Please help

Hi all

please help me as I need this so urgent 

I have created a label called lblResult

 

i set a variable called varToWork

and I have a list box “Yes”, and “No”

 

I want if I choose the yes From the list box a text will appear Ready and the lblResult to be green color

and if I select the No the text to appear Not Ready the lblResult box color to yelloe

 

how do I code that? Please help

 

1 ACCEPTED SOLUTION

Accepted Solutions

I believe that you have to use comma (,) and not semicolon (;). Can you try it, please?
I think that can be for language

 

Rellenar: Si (ListBox1.Selected.Value = "YES", Green, Yellow)

Texto: If (ListBox1.Selected.Value = "YES", "READY", "NOT READY")

View solution in original post

11 REPLIES 11
JhonatanOB1993
Helper II
Helper II

I believe this solution can be help you.

 

For txtResult you can use If(Dropdown1.Selected.Value = "YES"; "READY"; "NOT READY") and for fill, If(Dropdown1.Selected.Value = "YES"; Green; Yellow).

 

I hope both sentences help you.

 

 

 

Thank you so much for replying, I am not using a Dropdown I am using a ListBox. I changed the word Dropdown but gave me error.

I believe it will be too similiar, for example, now your sentences will be

Fill: If (ListBox1.Selected.Value = "YES"; Green; Yellow)

Text: If (ListBox1.Selected.Value = "YES"; "READY"; "NOT READY")

 

Finally, for ListBox1 property SelectMultiple you have to select false

I am not sure what I am doing wrong tried it again, didn't work

I believe that you have to use comma (,) and not semicolon (;). Can you try it, please?
I think that can be for language

 

Rellenar: Si (ListBox1.Selected.Value = "YES", Green, Yellow)

Texto: If (ListBox1.Selected.Value = "YES", "READY", "NOT READY")

View solution in original post

Yes, it worked. Thank you so much. I am very new and still in learning process. 

Any question you have, You don't hesitate to communicate it. We all go through the learning curve and we are there to support each other.

 

Good weekend

One more thing please, if I have ListBox1, 2 and 3 and want to put them together like this, do I put at the end ; ???

 

If(ListBox1.Selected.Value = "YES", "NOT READY")

If(ListBox2.Selected.Value = "YES", "NOT READY")

If(ListBox3.Selected.Value = "YES", "READY", "NOT READY")

Sorry, I didn't understand you. Can you explain more, please?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,817)