web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Required Field with Pa...
Power Apps
Unanswered

Required Field with Patch Part 2

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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?

Categories:
I have the same question (0)
  • MB-02102022-0 Profile Picture
    Microsoft Employee on at

    The easiest way to do this would be to construct a boolean statement like so...

     

    If(!(Toggle1 && Toggle1_3 && Toggle1_1 && Toggle1_2), "true","false")

    If any of the toggles is false then the single if statement will evaluate to "True"

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Here is what I am using If(!(DataCardValue91 && DataCardValue92 && DataCardValue93 && DataCardValue94), "true","false")

     

    Doing this throws an error for each of the DataCardValues saying "Invalid argument type. Expecting one of the following:Boolean, Number, Text"

     

    I tried replacing the true, false with Yes, No, but that does not work either.

    2018-05-01_14-54-26.jpg
  • MB-02102022-0 Profile Picture
    Microsoft Employee on at

    I think you'll need to apply an additional function for each DataCardValue to get a true/false.

     

    For example, if you wanted to make sure none of the fields were empty, you could write the following

     

     If((IsBlank(DataCardValue91) || IsBlank(DataCardValue92) || IsBlank(DataCardValue93) || IsBlank(DataCardValue94)), "true","false")

    Do you mind sharing what types of controls your DataCardValues are?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have a screen shot of the one I am using. I first added the Yes\No Checkbox from SharePoint Online and then changed it to be the edit Options as you see in the attached image. 

     

    I am still getting the error with the additional funchtion.

    2018-05-01_15-23-03-Type.jpg
  • MB-02102022-0 Profile Picture
    Microsoft Employee on at

    I see... try changing the query to reference the DataCard, instead of the DataCardValue, like so:

     

    If(DataCard.Update,'true','false')
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I think we are getting closer. I was able to get this not have any errors with what you provided, but I can't ge the pop up to happen anymore. I have attached a screen capture showing what I am using and you will notice that I have Yes,No, and I did try true,false aslo.

    2018-05-03_6-25-37-Function.jpg
  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    I do this differently. I set all of the fields to OnChange (or OnCheck if you want) to UpdateContext({PopUpVar: true}) that way if they get toggled they fire the popup. Then when you interact with the popup and are done you just set PopUpVar back to false. 

     

    You can see similar in action in my Password Screen app.

  • MB-02102022-0 Profile Picture
    Microsoft Employee on at

    Yes/No and True/False were just example text. Instead of outputing strings, you can conditionally open your popup. For example, if the If statement evaluates to true, you can call the code that opens up your popup.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I am starting to get a headache trying to wrap my head around some of this. 😉

     

    Let me take a step back to explain this a bit. I have a group of 5 toggle switches with one text field. If anyone of those toggle switches equal false or No and the text field is Blank, then the pop up should trigger using Set(MyVis,true).

     

    So basically what I have so far is something checking all the switches and not the text field. Is the outputting string another If statement with false as being the condition? 

    If((DataCard123.Update) || (DataCard124.Update) || (DataCard125.Update), If("false"(Set(MyVis,true))

     

    I am really confused at this point. Sorry, I am not understanding.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard