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

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
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 (91,079)