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
Community Support Team
Community Support Team

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

1 REPLY 1
Community Support Team
Community Support Team

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 307 members 4,786 guests
Please welcome our newest community members: