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 Fields in Form
Power Apps
Unanswered

Required Fields in Form

(0) ShareShare
ReportReport
Posted on by 43

Hi guys,

 

So, I have just made some fields in my SharePoint list to be "required", my App updated fine, didn't need to delete and add the form again.

What I would like to do now, if you do not fill in one of the required fields it leaves you on the same page and an error comes up. What I am getting now is that it navigates to the next page like I want it to but then comes up with the error.

 

Is there something I can add to my formula to get it to check.

 

Thanks,

Amy.

Categories:
I have the same question (0)
  • SteveMC Profile Picture
    21 on at

    I'm not sure how you have everythign setup, but it sounds like you have a button to submit the form and Navigate to another screen. Try moving your Navigate() function to the OnSuccess action in the form's advanced tab.

    This way, if the fields pass validation, OnSuccess fires, and the navgation happens. If the fields fail validation, OnFailure fires, which should do nothing, provided OnFailure is set to false.

     

    Hope this helps

  • amydixanne Profile Picture
    43 on at

    Hi @SteveMC

     

    I have a button on my form page that has a Patch() and Navigate().

     

    I have looked for a OnSuccess and OnFailure in the Advanced settings of the button but cannot see either.

    Any ideas?

     

    Thanks,

     

    Amy.

  • amydixanne Profile Picture
    43 on at

    hi again @SteveMC

     

    Sorry helps if you actually read the full post. I have added the OnSuccess for the form and the onfailure is set to false.

     

    So my next problem is, even with the on success and onfailure and the required fields, it saves anyway. No error messages come up anymore.

    Any advice?

     

    Thanks.

  • SteveMC Profile Picture
    21 on at

    If it's actually saving the item to your SharePoint list with the Submit() function, then it's passing the validation test on the SharePoint side.

    Try refreshing your datasource (under View > Datasources, click elipsis and Refresh), then make sure the Datacards that hold the fields you want validated have their required property set to "true" (In the Datacard's Advanced tab).

    Hope this helps

  • amydixanne Profile Picture
    43 on at

    Hi @SteveMC

     

    I am using a Patch() function on my submit button. Which works perfectly.

    I am not getting errors with the app anymore like I did (the red bar across the top). There really needs to be an error of some sorts otherwise people are going to think that their incident was submitted.

     

    Also, when all the fields required are filled in, the OnSuccess navigate does not happen. It stays on the same page, so again people are going to think that their incident has/has not been submitted.

     

    Thanks,

     

    amy.

  • SteveMC Profile Picture
    21 on at

    Sorry, I missed that you were using Patch(). That won't trigger the OnSubmit action. There are a few different approaches to validate using Patch()... Again, I don't know the complexity of your app, but if you have a single form and your goal is to bring people to a "Success" page if validation passes, or keep them on the same page if validation fails, using SubmitForm() may be an approach you want to consider.

     

    But if you need to use Patch(), There are ways to validate the form using the Validate() and Errors() function.

  • amydixanne Profile Picture
    43 on at

    Okay, I am still wondering on this.

     

    I am currently using a Patch() on my Submit form as I need to patch the person/group column. 

     

    If I use the patch() I am no longer getting any error messages about the required fields not being filled in nor is the page going to Success Page which it isn't meant to do anyway.

     

    Does anyone know how to use validate() and error() functions. I have had a look around but not entirely sure how to get it to work with an OnSuccess on the form at the same time.

     

    Any help would be greatly appreciated.

     

    Thanks,

     

    Amy

  • davidstone Profile Picture
    471 on at

    I don't use patch, but it looks (here) like you can validate the entire form, and check to see if the result of that validation is blank - and then only proceed if it is blank. If it's not blank, you'll get the error message from the validation.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 96 Super User 2026 Season 1

Last 30 days Overall leaderboard