cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ashok2
Level: Powered On

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

Re: validation of forms in powerapps

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
WarrenBelz
Level 8

Re: validation of forms in powerapps

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.

Highlighted
Ashok2
Level: Powered On

Re: validation of forms in powerapps

Tried below syntax but getting error

 

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

WarrenBelz
Level 8

Re: validation of forms in powerapps

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

Re: validation of forms in powerapps

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

Re: validation of forms in powerapps

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,058)