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 / Vaidate if multiple te...
Power Apps
Unanswered

Vaidate if multiple textboxes not filled in

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have 5 textboxes on a screen.

 

I need all 5 to be filled with data

IF

any one of the five have text in them.

They must complete the other 4 textboxes.

 

DAVIDPOWELL_0-1659730094244.png

 

Thanks

Dave

Categories:
I have the same question (0)
  • zuurg Profile Picture
    546 Super User 2024 Season 1 on at

    Are these boxes on a form?  

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    no, they are not part of a form

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    You don't specify the action that will next be taken once the textboxes are filled in but assuming you are either  going to save them or move on to the next screen, I would approach this by using a context variable as a counter.

    and enabling or disabling that control until the criteria are met.

    First, leave a message in the Default property of the textboxes so they are not blank to start with. This is done so that when the user removes the default text, the counter is set back. To do this, highlight all the textbox controls and in the OnChange property.  The first time a user puts information in one of the boxes, a message will be sent that all the boxes must be filled. 

     

     

    If(
     IsBlank(Self.Text),
     UpdateContext({var: var - 1}),
     UpdateContext({var: var + 1})
    );
    If(
     var = 1,
     Notify(
     "All five boxes need to be filled",
     NotificationType.Information
     )
    )

     

     

    In a save button or next button DisplayMode property

     

     

    If(var=0 || var=5,Edit,Disabled)

     

     

    To reset everything in the OnVisible property of the screen and in the Next or a Patch() button, 

     

     

    Reset(TextInput1);
    Reset(TextInput2);
    Reset(TextInput3);
    Reset(TextInput4);
    Reset(TextInput5);
    UpdateContext({var: 0})

     

     

     

     

     

     

     

  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    So for your button or whatever you have to move on to next screen and an error message can use this same logic. Just do something like this. 

     

    On a Button. DisplayMode property of it. If(textbox1.Text <> "" && textbox2.Text <> "" && Textbox3.Text <> "" && Textbox4.Text <> "" && Textbox5.Text <> "", DisplayMode.Edit,DisplayMode.Disabled) 

     

    This makes the button not clickable till all 5 have text in them. 

     

    Error message visable property.  (textbox1.Text = "" || textbox2.Text = "" || Textbox3.Text = "" || Textbox4.Text = "" || Textbox5.Text = "") || !(textbox1.Text = "" && textbox2.Text = "" && Textbox3.Text = "" && Textbox4.Text = "" && Textbox5.Text = "")

     

    Show the error message if any of the Textboxes are blank unless All the Text Boxes are blank (OR Not 😃

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 490

#2
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 381

Last 30 days Overall leaderboard