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

Visible if statment not working

Hi i have a forms app where i have a If Statement on the visible function of several datacards.

 

On the start page of the app the users select the vehicle and the service type 250, 500, 1000 or 2000 and that number is displayed on a label on the following screen, so i set the following if statement on the visible part of the datacard as if they select 2000 they should see all the datacards and if they select 500 for example they should only see the 250 and 500 parts, however it is not working,

 

To show all i would use

 

If(Value(DCVSMUTop.Text) = 250 || 500 || 1000 || 2000, true,false)

 

To show just 500 i would use

 

If(Value(DCVSMUTop.Text) = 250 || 500, true,false)

 

PS. DCVSMUTop is the name of the label on the top part of the screen

 

Could someone tell me where im wrong?

 

Thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Community Champion
Community Champion

@ShaneITAutomate Try this,

With({varDCVSMUTop:Value(DCVSMUTop.Text)},
 varDCVSMUTop = 250 || varDCVSMUTop = 500 || varDCVSMUTop = 1000 || varDCVSMUTop = 2000
)

View solution in original post

5 REPLIES 5
pat_aus
Frequent Visitor

Hi ShareITAutomate,

 

Try the following

 

If(Value(DCVSMUTop.Text) = 250 || Value(DCVSMUTop.Text) = 500 || Value(DCVSMUTop.Text) = 1000 || Value(DCVSMUTop.Text) = 2000, true,false)

 

If(Value(DCVSMUTop.Text) = 250 || Value(DCVSMUTop.Text) = 500, true,false)

 

CNT
Community Champion
Community Champion

@ShaneITAutomate Try this,

With({varDCVSMUTop:Value(DCVSMUTop.Text)},
 varDCVSMUTop = 250 || varDCVSMUTop = 500 || varDCVSMUTop = 1000 || varDCVSMUTop = 2000
)

View solution in original post

Drrickryp
Super User II
Super User II

@ShaneITAutomate 

As @CNT shows in his formula, it is almost never necessary to use an If() statement with Visible when the formula by itself reduces to either true or false. 

ignore first thing monday had a brain fart

ignore first thing monday had a brain fart

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.

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