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 / Add validation in powe...
Power Apps
Suggested Answer

Add validation in powerapp forms

(2) ShareShare
ReportReport
Posted on by 595
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,969 Moderator 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

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 577

#2
WarrenBelz Profile Picture

WarrenBelz 440 Most Valuable Professional

#3
Haque Profile Picture

Haque 308

Last 30 days Overall leaderboard