cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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 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
Highlighted
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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

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