cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

validation of forms in powerapps

I am trying to validate form onsuccess but its not working for patch updates it only work on submit forms

Form2,updates is the form where validation is required 

 

Patch(SPlist, SelectedItem, Form_1.Updates, Form2.Updates,Form3.Updates);

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Ashok2 ,

Currently, within PowerApps app, the Form validation mechanism only work when you use SubmitForm function to submit form data, it would not work for Patch function.

 

In addition, based on the formula that you mentioned, I think there is something wrong with it. Please consider modify your formula as below:

If(
    IsEmpty(
            Errors(
                    SPlist,  // Modify here. Specify your SP List data source here
                    Patch(SPlist, SelectedItem, Form_1.Updates, Form2.Updates, Form3.Updates)
            )
    ),
    ResetForm(Form_1);ResetForm(Form2);ResetForm(Form3);Back(),
    Notify("There is something wrong when you submit form data" & First(Errors(SPlist)).Message, NotificationType.Error)
)

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

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

5 REPLIES 5
Super User III
Super User III

Hi @Ashok2 ,

Have a read of this post - it may resolve your issue.

 

 

Please click and accept as Solution if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

Tried below syntax but getting error

 

If(
IsEmpty(
Errors(
Patch(SPlist, SelectedItem, Form_1.Updates, Form2.Updates,Form3.Updates);
)
)
)

Hi @Ashok2 ,

The Errors function needs to be used after the patch - you need to check on the result of the Patch after it has been applied.

 

Please click and accept as Solution if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

Community Support
Community Support

Hi @Ashok2 ,

Currently, within PowerApps app, the Form validation mechanism only work when you use SubmitForm function to submit form data, it would not work for Patch function.

 

In addition, based on the formula that you mentioned, I think there is something wrong with it. Please consider modify your formula as below:

If(
    IsEmpty(
            Errors(
                    SPlist,  // Modify here. Specify your SP List data source here
                    Patch(SPlist, SelectedItem, Form_1.Updates, Form2.Updates, Form3.Updates)
            )
    ),
    ResetForm(Form_1);ResetForm(Form2);ResetForm(Form3);Back(),
    Notify("There is something wrong when you submit form data" & First(Errors(SPlist)).Message, NotificationType.Error)
)

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

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

Super User
Super User

Hi @Ashok2 ,

Please note that the Submitform will work exactly like a patch, but if there are not changes to update, it won't send any data to the server which is quite cool.

 

Below is a method that we are using for form validation that is very easy to implement and works very well.

 

Let me know if you don't come right.

https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Microsoft-PowerApps-Form-Validation/m...

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please like it and mark this as the answer to close the topic and make it easier to find for other people with similar questions.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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