cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shaneOZ
Responsive Resident
Responsive Resident

Multiple IF Statment help, need a label to be visible if a radio button = yes and a text box is empty

Like the title says,

 

this is the code im using in the labels visible, however im 99% sure the code can be written better and needs a tidy.

 

Or did i get it right?

 

 

If (
take5radio1_3.Selected.Value = "Yes",
If(
IsBlank(Control3.Text),
true,
If(take5radio1_3.Selected.Value = "No" || !IsBlank(Control3.Text) ,false,
true
)))

 

1 ACCEPTED SOLUTION

Accepted Solutions

@shaneOZ ,

Strange - see below - this should definitely work

Visible2Factor.png

Visible2Factor.gif

View solution in original post

6 REPLIES 6
KrishnaV
Super User III
Super User III

Hi Shane,

 

Use this formula on Label visible property:
If(IsBlank(TextInput4.Text) && Radio1.Selected.Value = "Yes", true,false)

 

Note: Mark as a solution if this helps you.

 

Regards,

Krishna


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

@shaneOZ ,

You can shorten that even further

take5radio1_3.Selected.Value = "Yes" &&  IsBlank(Control3.Text)

Both are boolean tests and if both are true, your control will be visible

shaneOZ
Responsive Resident
Responsive Resident


@WarrenBelz wrote:

@shaneOZ ,

You can shorten that even further

 

take5radio1_3.Selected.Value = "Yes" &&  IsBlank(Control3.Text)

 

Both are boolean tests and if both are true, your control will be visible


Yeah i tried that first, however if the value was No and blank the label also showed? I was a little confused as to why.

No that is not possible just ensure that it is set to visible property. Because as warren sai if they both are true then it will be visible if anyone is false it will be hidden.

 

if that still shows close the PowerApp and reopen it and ensure that you are testing on the updated solution, not the old version ( I mean if you go and click the published version with the old code block).

 

Regards,

Krishna


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

@shaneOZ ,

Strange - see below - this should definitely work

Visible2Factor.png

Visible2Factor.gif

View solution in original post

shaneOZ
Responsive Resident
Responsive Resident

Yeah couldn't tell you why it wasn't working. Yet woke up today and its working perfect?

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (73,243)