Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Error Handling
Unanswered

Power Apps Validate function issue/bug

(0) ShareShare
ReportReport
Posted on by 69

I've been using the Validate function to check form values for errors prior to submission based on the default required fields in my form, however I have noticed a strange issue where required fields, when left blank, are initially successfully caught by the validate function if no data is added to them, but if I enter text to make it pass validation from a required field, then remove that text to make it blank again, the validate function doesn't catch that the required field is blank anymore.

 

Does anyone know if this is a bug or somehow by design?

 

Steps to replicate:

- Create a form "MainForm" referencing a sharepoint list with two or more required fields.

- Create a button to check for errors. Button onSelect code:

 

 // Check for errors before presenting confirmation dialog
 Set(
 varValidateForm,
 Validate(
 'My SharePoint List',
 Defaults('My SharePoint List'),
 MainForm.Updates
 )
 );
 // If there are no errors submit, otherwise notify
 If(
 IsBlank(varValidateForm),
 Submit(MainForm)
 ,
 // Otherwise highlight validation Errors.
 Notify(
 varValidateForm,
 NotificationType.Error
 )
 );

 

 

- Create a new item, hit the button (should see an error about the required field being blank).

- Add some text to the first required field and hit submit (that field should no longer throw an error and it'll flag the next required field error instead).

- Remove the text entered into the initial required field and submit (the error for the first field error doesn't get flagged again despite there being no data in the field anymore).

 

Related Function: Validate function - Power Platform | Microsoft Learn

Categories:
  • huyngochoang Profile Picture
    2 on at
    Re: Power Apps Validate function issue/bug

    I don't see this bug. I tried to replicate your steps but the moment I remove the text entered into the initial required field, a red error text underneath that field will show up and said the field is required.

     

    Hence I think maybe you made some custom code to your form to change the defaulf behavior of the form. Also, when you trigger function SubmitForm without using Validation form, the function will still validate the form against the datasource information.

     

    So I suggest you should use the IsValid for the form to enable/disable the Submit button accordingly, something like SubmitButton.DisplayMode = If(MainForm.IsValid, DisplayMode.Edit, DisplayMode.Disabled)

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Error Handling

#1
stampcoin Profile Picture

stampcoin 75

#2
DS-11051211-0 Profile Picture

DS-11051211-0 20

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 9

Overall leaderboard

Featured topics