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

Multiple End/Or condition is not working as expected!

Hello,

 

My objective is to change know if all field values are not null, for which I have set text attribute of label as follows:

 

If((DataCardValue1.Text="") Or (DataCardValue3.Text="") Or (DataCardValue7.Text="") Or IsBlank(DataCardValue4.Selected.Value),"Yes","No")

 

This is not working as expected, Meaning, even if "DataCardValue7.Text" == "" , it still shows "Yes" instead of "No"

 

Can you please share how can I change the formula so that, only if all field values are filled, then it should display "Yes" else "No" ?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

for some reasons, below formula worked out!

 

//Check for any blank values
Set(IsValid,!Or(!IsBlank(txtbox1.Text),!IsBlank(txtbox2.Text),!IsBlank(txtbox3.Text),!IsBlank(dropdown.Selected)));

 

//verify
If(IsValid,"Yes","No");

 

Thanks,

View solution in original post

5 REPLIES 5
Super User II
Super User II

Hi @dave8 ,

If((DataCardValue1.Text="") Or (DataCardValue3.Text="") Or (DataCardValue7.Text="") Or IsBlank(DataCardValue4.Selected.Value),"No","Yes")

 

why don't you use IsBlank function ? 

 If(IsBlank(DataCardValue1.Text) || IsBlank(DataCardValue3.Text) || IsBlank(DataCardValue7.Text) || IsBlank(DataCardValue4.Selected.Value),"No","Yes")

or may be Len function ?

 If(Len(DataCardValue1.Text)=0 || Len(DataCardValue3.Text)=0 || Len(DataCardValue7.Text="")=0 || IsBlank(DataCardValue4.Selected.Value),"No","Yes")

Hi @gabibalaban 

 

I have tried on followings and it only works, if I change dropdown value "DataCardValue4.Selected" while other text values are not affecting the condition at all.

 

Meaning, If DataCardValue4.Selected = some value, then only it types "Yes", else "No" regardless of other text values in the condition.

 

If( IsBlank(DataCardValue1.Text="") || IsBlank(DataCardValue3.Text="") || IsBlank(DataCardValue4.Selected) || IsBlank(DataCardValue7.Text=""),"No","Yes")

 

Any clue? Is it so that dropdown/text doesnt work in condition together as expected?

 

Thanks,

 

This is a little piece of information that is new ...DataCardValue4 is a dropdown (i was sure that is a ComboBox).

In this case, from what I know and what I tested, a DropDown control is always set with a value, even if you reset the control and the Default property is not set,  the DropDown.Selected value is loaded with first item of DropDown items, so is never Blank ... that's why this condition is always False (because DataCardValue4.Selected.Value has a value).

 

Can you try the formula using a ComboBox instead of DropDown, ComboBox allow blank selection.

 

Hope it helps !

Thank you to update, I am not sure if this is the case, because IsBlank(dropdown.selected) will always specify if dropdown is blank or not - this is tested and it works. However I am not sure together with textboxes it works as expected or not!

 

In this case, there is something wrong with the condition/formula I think!

 

any clue/suggestion?

 

for some reasons, below formula worked out!

 

//Check for any blank values
Set(IsValid,!Or(!IsBlank(txtbox1.Text),!IsBlank(txtbox2.Text),!IsBlank(txtbox3.Text),!IsBlank(dropdown.Selected)));

 

//verify
If(IsValid,"Yes","No");

 

Thanks,

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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