Hello,
Is it possible to leverage the Form.Error property without the Submit() function (for an offline app i'm building)?
Use Case:
Rationale:
I'm thinking something like: Set(varAlarms, Form.Error = true), but this doesn' work. Basically, is the SubmitForm() error handling exposed anywhere?
Thank you
Solved! Go to Solution.
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 SubmitForm, EditForm, or ResetForm function runs.
More details about the Error property of the Edit form control, please check the following article:
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:
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:
Best regards,
Kris
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 SubmitForm, EditForm, or ResetForm function runs.
More details about the Error property of the Edit form control, please check the following article:
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:
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:
Best regards,
Kris
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
User | Count |
---|---|
225 | |
101 | |
93 | |
57 | |
31 |
User | Count |
---|---|
284 | |
116 | |
109 | |
63 | |
57 |