cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

FORMS: Set Form.Error?

Hello,

Is it possible to leverage the Form.Error property without the Submit() function (for an offline app i'm building)?

Use Case:

  • Set Data Cards (in Form) as Required
  • User does not enter a value
  • Clicks "Submit" button
  • Show Errors WITHOUT hitting the SubmitForm() function.

Rationale:

  • This app will use Patch() not SubmitForm()
  • I want to use Form built-in error handling

I'm thinking something like: Set(varAlarms, Form.Error = true), but this doesn' work. Basically, is the SubmitForm() error handling exposed anywhere?

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: FORMS: Set Form.Error?

Hi @ericonline,

Do you want to leverage the Form.Error property when using Patch function instead of SubmitForm function?

I think you have some misunderstanding in the Error proeprty of the Edit form control. The Error property is a user friendly error message to display for this form when the SubmitForm function fails.

The Error property applies only to the Edit form control, and changes only when the SubmitFormEditForm, or ResetForm function runs.

More details about the Error property of the Edit form control, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-form-detail#key-proper...

If you want to leverage the Form.Error property when using Patch function instead of SubmitForm function, I afraid that there is no way to achieve your needs in PowerApps currently.

As an alternative solution, you could consider take a try to add a If condition to check if the Required/Mandatory field is Blank, if yes, notify the user a error message.

I have made a test on my side, please take a try with the following workaround:1.JPG

Set the OnSelect property of the "Submit" button to following:

If(
    IsBlank(DataCardValue7.Text), /*<-DataCardValue7 represents the TextInput box within the Required field (Data Card)*/
    Notify("There are still some Required/Mandatory fields are not provided values in your Edit form",NotificationType.Error),
    Patch('20181122_case14',Defaults('20181122_case14'),EditForm1.Updates)
)

On your side, you should type the following:

If(
    IsBlank(DataCardValue1.Text) || IsBlank(DataCardValue2.Text) || IsBlank(DataCardValue3.Text) || ...,
    Notify("There are still some Required/Mandatory fields are not provided values in your Edit form",NotificationType.Error),
    Patch('YourSPList',Defaults('YourSOList'), EditForm1.Updates) /* <-- your Patch function */
)

The GIF screenshot as below:Test1.gif

 

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: FORMS: Set Form.Error?

Hi @ericonline,

Do you want to leverage the Form.Error property when using Patch function instead of SubmitForm function?

I think you have some misunderstanding in the Error proeprty of the Edit form control. The Error property is a user friendly error message to display for this form when the SubmitForm function fails.

The Error property applies only to the Edit form control, and changes only when the SubmitFormEditForm, or ResetForm function runs.

More details about the Error property of the Edit form control, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-form-detail#key-proper...

If you want to leverage the Form.Error property when using Patch function instead of SubmitForm function, I afraid that there is no way to achieve your needs in PowerApps currently.

As an alternative solution, you could consider take a try to add a If condition to check if the Required/Mandatory field is Blank, if yes, notify the user a error message.

I have made a test on my side, please take a try with the following workaround:1.JPG

Set the OnSelect property of the "Submit" button to following:

If(
    IsBlank(DataCardValue7.Text), /*<-DataCardValue7 represents the TextInput box within the Required field (Data Card)*/
    Notify("There are still some Required/Mandatory fields are not provided values in your Edit form",NotificationType.Error),
    Patch('20181122_case14',Defaults('20181122_case14'),EditForm1.Updates)
)

On your side, you should type the following:

If(
    IsBlank(DataCardValue1.Text) || IsBlank(DataCardValue2.Text) || IsBlank(DataCardValue3.Text) || ...,
    Notify("There are still some Required/Mandatory fields are not provided values in your Edit form",NotificationType.Error),
    Patch('YourSPList',Defaults('YourSOList'), EditForm1.Updates) /* <-- your Patch function */
)

The GIF screenshot as below:Test1.gif

 

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Advocate III
Advocate III

Re: FORMS: Set Form.Error?

so is there a way to force validation of the powerapp form without the save button being used to submit.  Reason I'm asking is apparantly power app has a new bug.  Old app just broke.  When the user clicks save an gets an error on a required field and fixes it and clicks save again it hangs and wont do anything.  So trying to find a way to maybe add a button to validate the form without submitting in hopes I can work around this new powerapp bug.  Some have suggested in the save button before submit checking all the field but I'm  not going there.  This is a complex form with required fields that are based on other fields.  Any ideas would be appreciated.    Since the submit with errors seems to be the problem, trying to find a way to check fields before submit without doing every field checked again

Highlighted
Super User III
Super User III

Re: FORMS: Set Form.Error?

Hi @dmclaughlin ,

Here is a link to a heap of users with the same issue.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,079)