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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add validation in powe...
Power Apps
Unanswered

Add validation in powerapp forms

(2) ShareShare
ReportReport
Posted on by 531
I have a newform in powerapps. I want the validation to be implemented in powerapps side, rather than setting the required field in datasource.
 
I understand that if we set the required field to true in a datacard and use SubmitForm() function, it automatically throws validation error in the form in red color stating "Field is required". .
 
However, here i am using Preview button, which just navigates to the next screen, Any idea how to implement similar validation on click of Preview button? 
 
I shouldn't allow user to navigate to next screen on click of Preview button, unless all required fields are filled in. 
Categories:
I have the same question (0)
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
     
    Yes, you can use the below in your Button's DisplayMode property after setting the required fields to true:
    If(
        FormName.Valid = false,
        DisplayMode.Disabled,
        DisplayMode.Edit
    )
    This will keep the button disabled until the user fills out all the required fields. 
     
    You can also use this on the OnSelect property as well. Like this:
    If(
        FormName.Valid,
        Navigate(
            ScreenName,
            ScreenTransition.Fade
        ),
        Notify(
            "Please fill out all the required fields before previewing.",
            NotificationType.Warning
        )
    )
     
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     
     
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi,
     
    Since you are NOT looking at the back end to tell you for sure, then you need to actually add in Checks for the validate.
     
    Now you can do this several ways but, here is the simplest.
     
    In your Button OnSelect
     
    let's assume you have a Text Box and a Dropdown
     
    In your DisplayMode,
     
    If(!IsBlank(MyTextBox.Text) And !IsBlank(MyDropdown.Selected),
        DisplayMode.Edit,
        DisplayMode.Disabled
    );
     
    Just remember to add the check as part of the if, for each control you have. Also remember to do it to the control, NOT the datacards where the control sits, people do that by accident, meaning to select the control to get the name and only select the Card.
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard