cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dave8
Impactful Individual
Impactful Individual

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
dave8
Impactful Individual
Impactful Individual

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
gabibalaban
Super User
Super User

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")

dave8
Impactful Individual
Impactful Individual

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 !

dave8
Impactful Individual
Impactful Individual

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?

 

dave8
Impactful Individual
Impactful Individual

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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