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 Apps
Suggested Answer

Form Validation

(1) ShareShare
ReportReport
Posted on by 114
Is there a way of validating whether a form has data in all of its required fields in one go, rather than checking each field individually before submitting? I have a form with over 50 fields and I'd prefer not to have to write out that code manually.
 
I have a weird error where I try to submit a form but an error is thrown suggesting there is an empty field that needs filled but I can't work out which one it is. I have this code a the moment to try and help show me the column but is failing to pickup the column name - 
 
Notify(Concat(Errors("Datasource"),Column&": "&Message),NotificationType.Error)
 
 
Any ideas of why this is not working or how to validate the full form before submission?
 
Categories:
I have the same question (0)
  • Suggested answer
    WarrenBelz Profile Picture
    155,752 Most Valuable Professional on at
    The Valid test generally works
    If(
       YourFormName.Valid,
       SubmitForm(FormName),
       Notify( . . . . 
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at
    If you're using an editform, you can use the "Valid" property to check if everything in the form is valid. 

    From the help docs, here's code to enable the submit button only when the form is valid:
    SubmitButton.DisplayMode = If(IsBlank( Form.Error ) || Form.Valid, DisplayMode.Edit, DisplayMode.Disabled)
     
    Of course, this requires the fields to be set up with proper settings, such as whether they are required, so that the form knows what is or isn't valid. If you're getting errors after submit, perhaps the field in the data source is required, but perhaps the card in the form was unlocked and customlzed? Check the "required' property of each card to make sure that they match the settings in the data source. 
  • WarrenBelz Profile Picture
    155,752 Most Valuable Professional on at
     
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • toomuchcoffee1122 Profile Picture
    114 on at
    @WarrenBelz this sort of works but I am still unable to find out which specific field is not validating correctly, which is the main crux of the problem.
  • WarrenBelz Profile Picture
    155,752 Most Valuable Professional on at
    You have a bit of hard-coding to do (check each one and then generate a message) or make the built-in error message in the data cards visible if the control is blank and a variable is set to true when you try to save.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • Suggested answer
    toomuchcoffee1122 Profile Picture
    114 on at
    I have implemented a bit of a workaround to this issue - the fields that are of type LookUp are now set to View Display Mode, and it appears to have solved the issue. The form was requiring the user to click onto each tab to "load" the data in the form (I think), and setting the fields to View display mode has eliminated this problem. The data was in the form but it wasn't being loaded.

    It's not an ideal solution by any means but it works. I am considering raising this as a bug to Microsoft.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard