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

Required Field with Patch Part 2

This is a follow up question to this post. https://powerusers.microsoft.com/t5/General-Discussion/Required-Field-with-Patch/td-p/110674

 

If I have 10 controls with the true/false, what is the easiest way to only throw the pop up message if just any one of those controls equals false? If it is just a bunch of IF statements how do I stack all of them?

14 REPLIES 14
Highlighted

I got this statement to kind of work. If anyone of the toggles are No it will prompt, but if they are all Yes, it will not advance to the next page. I also need to figure out how to make sure if one is set to No that it will be able to advance as long as the text box has something in it. So basicly the idea is if there are any No's, there should be a reason filled out in the text box as to why.

 

If(DataCardValue91.Selected.Value="No", Set(MyVis,true) || If(DataCardValue92.Selected.Value="No", Set(MyVis,true) || If(DataCardValue93.Selected.Value="No", Set(MyVis,true) || If(DataCardValue94.Selected.Value="No", Set(MyVis,true) || If(DataCardValue12.Selected.Value="No", Set(MyVis,true), NewForm(Form_2);Navigate('Page-2',ScreenTransition.Fade))))))

Highlighted

Love your videos Shane, but I am looking for low code if possible. I have 12 pages with 10 fields each. I have not had a chance to check out the password screen app, but looking forward to it. 

Highlighted

Hey @msmith I didn't make the video to answer your question (sorry) but I did realize that you are missing one of the tricks of stacking IFs with PowerApps. This video PowerApps If Statement shows you how to do an if statement like this (I am trying to translate your so may not be perfect):

 

If(

DataCardValue91.Selected.Value="No", Set(MyVis,true),

DataCardValue92.Selected.Value="No", Set(MyVis,true),

DataCardValue93.Selected.Value="No", Set(MyVis,true),

DataCardValue94.Selected.Value="No", Set(MyVis,true),

DataCardValue12.Selected.Value="No", Set(MyVis,true),

NewForm(Form_2);Navigate('Page-2',ScreenTransition.Fade)

)

 

I explain how that works in the video but the upside is that is a lot easier to follow once you understand it. Long story short if any of those are "No" then set the variable. If they are all Yes you get to the bottom and create the new form and navigate to the new screen.

 

Hope that helps and makes sense.

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
Highlighted

That and the video was really helpful. Can you tell my why this statement won't work the if I want to compare two fields, Toggle and Text box. If Toggle = No & TextBox is Blank then Set(MyVis,True)

 

If(DataCardValue91.Selected.Value="No" & (IsBlank(DataCardValue116)), Set(MyVis,true), If(DataCardValue92.Selected.Value="No" & (IsBlank(DataCardValue116)), Set(MyVis,true), If(DataCardValue93.Selected.Value="No" & (IsBlank(DataCardValue116)), Set(MyVis,true),If(DataCardValue94.Selected.Value="No" & (IsBlank(DataCardValue116)), Set(MyVis,true), If(DataCardValue12.Selected.Value="No" & (IsBlank(DataCardValue116)), Set(MyVis,true), NewForm(Form_2);Navigate('Page-2',ScreenTransition.Fade))))))

Highlighted

Nice I was able to figure this out with the help of both you guys. Thank you!!

 

If(DataCardValue91.Selected.Value="No" && (IsBlank(DataCardValue116)), Set(MyVis,true), If(DataCardValue92.Selected.Value="No" && (IsBlank(DataCardValue116)), Set(MyVis,true), If(DataCardValue93.Selected.Value="No" && (IsBlank(DataCardValue116)), Set(MyVis,true),If(DataCardValue94.Selected.Value="No" && (IsBlank(DataCardValue116)), Set(MyVis,true), If(DataCardValue12.Selected.Value="No" && (IsBlank(DataCardValue116)), Set(MyVis,true), NewForm(Form_2);Navigate('-2',ScreenTransition.Fade))))))

 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

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

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,700)