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);
Solved! Go to Solution.
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,
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.
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,
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.
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.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
203 | |
171 | |
63 | |
32 | |
31 |
User | Count |
---|---|
339 | |
271 | |
105 | |
71 | |
56 |