cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shanemeisner
Helper V
Helper V

Help with Multiple Conditional checks for Visible Setting

I have the following Formula working to hide a message, or show a message, if the conditions are met:

If(!IsBlank(Statusval.Text),false, ReqType.Selected.Value = "Vendor Add", false, ReqType.Selected.Value = "-", false, ReqType.Selected.Value = "Block Vendor", false, ReqType.Selected.Value = "Vendor Change"  && IsBlank(varVendorInfo) Or IsBlank(varVendorPay) Or IsBlank(varVendorw89) ,true, ReqType.Selected.Value = "Unblock Vendor" && IsBlank(varVendorInfo) Or IsBlank(varVendorPay) Or IsBlank(varVendorw89) ,true, false)

This show the message if the 3 Variables are blank and the Type selected is Change or Unblock.

I now am trying to add an additional check of a 2nd field and when doing so it "Loses its mind" on when to show or hide..
looking to change this: ReqType.Selected.Value = "Vendor Change" && IsBlank(varVendorInfo) Or IsBlank(varVendorPay) Or IsBlank(varVendorw89) ,true
to check a 2nd field:
ReqType.Selected.Value = "Vendor Change" && TypeVendor.Selected.value = "Purchase Order" &&  IsBlank(varVendorInfo) Or IsBlank(varVendorPay) Or IsBlank(varVendorw89) ,true

But doing a check of a 2nd field breaks the "Or" statement and the message doesn't continue to show when it should.

1 ACCEPTED SOLUTION

Accepted Solutions

Since I couldn't figure out a way to do it all in one.. I created two separate Labels.. where they hide based on the Type of Vendor Selected:

If(TypeVendor.Selected.Value = "Non-Purchase Order Vendor", false, !IsBlank(Statusval.Text), false, ReqType.Selected.Value = "Vendor Add", false, ReqType.Selected.Value = "-", false, ReqType.Selected.Value = "Block Vendor", false, ReqType.Selected.Value = "Vendor Change" && IsBlank(varVendorInfo) Or IsBlank(varVendorPay) Or IsBlank(varVendorw89) ,true, ReqType.Selected.Value = "Unblock Vendor" && IsBlank(varVendorInfo) Or IsBlank(varVendorPay) Or IsBlank(varVendorw89) ,true, false)

and the other one is: TypeVendor.Selected.Value = "Purchase Order Vendor", false,

 and it works as I need it..

View solution in original post

5 REPLIES 5
mdevaney
Super User III
Super User III

@shanemeisner 

Would throwing some brackets around the AND logic help?  Suggest you start by doing this and then experiment with placement of the brackets.

 

(ReqType.Selected.Value = "Vendor Change" && TypeVendor.Selected.value = "Purchase Order" &&  IsBlank(varVendorInfo)) Or IsBlank(varVendorPay) Or IsBlank(varVendorw89) ,true

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Thanks @mdevaney .. Tried placing brackets in a couple different places with no change.
1st attempt:
(ReqType.Selected.Value = "Vendor Change" && TypeVendor.Selected.Value = "Purchase Order Vendor" && IsBlank(varVendorInfo) Or IsBlank(varVendorPay) Or IsBlank(varVendorw89) ,true,
Then tried:

(ReqType.Selected.Value = "Vendor Change" && TypeVendor.Selected.Value = "Purchase Order Vendor" && IsBlank(varVendorInfo) ) Or IsBlank(varVendorPay) Or IsBlank(varVendorw89) ,true,

and lastly tried:

(ReqType.Selected.Value = "Vendor Change" && TypeVendor.Selected.Value = "Purchase Order Vendor" && IsBlank(varVendorInfo)  Or IsBlank(varVendorPay) Or IsBlank(varVendorw89)) ,true,

All ended up still showing the Message even though "TypeVendor" was not "Purchase Order Vendor" as shown below:

vendorchange.png

@shanemeisner 

It is likely showing because one of these OR conditions are true.

Or IsBlank(varVendorPay) Or IsBlank(varVendorw89)

 ---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Correct @mdevaney , they are.. But when it comes to a "Non-Purchase Order Vendor", the 

IsBlank(varVendorPay)

 Will always be blank.. So I need the message to be visible if the Vendor type is "Purchase Order" and the 3 Variables are blank.. 

But, if Vendor type is "Non-Purchase Order", then I will only want to check 2 of the 3 variables( haven't even started to add that yet).
At this point I can't get it to check both the Request Type and the Vendor type + the 3 Or Statements.
In the case of my screen shot, for this test, the message should be hidden as the Vendor type is Non-purchase order.. 
I did find that if I reduce my Variable check down to just two of them like this

 ReqType.Selected.Value = "Vendor Change" && TypeVendor.Selected.Value = "Purchase Order Vendor"  && IsBlank(varVendorInfo) Or IsBlank(varVendorPay),true
It worked.. it's adding the next "Or" that breaks the logic.

Since I couldn't figure out a way to do it all in one.. I created two separate Labels.. where they hide based on the Type of Vendor Selected:

If(TypeVendor.Selected.Value = "Non-Purchase Order Vendor", false, !IsBlank(Statusval.Text), false, ReqType.Selected.Value = "Vendor Add", false, ReqType.Selected.Value = "-", false, ReqType.Selected.Value = "Block Vendor", false, ReqType.Selected.Value = "Vendor Change" && IsBlank(varVendorInfo) Or IsBlank(varVendorPay) Or IsBlank(varVendorw89) ,true, ReqType.Selected.Value = "Unblock Vendor" && IsBlank(varVendorInfo) Or IsBlank(varVendorPay) Or IsBlank(varVendorw89) ,true, false)

and the other one is: TypeVendor.Selected.Value = "Purchase Order Vendor", false,

 and it works as I need it..

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

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

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