How to validate a PATCH function is successful or failure
- Sai Krishna
- Aug 4, 2020
- 1 min read
in this post let us see, how can we validate a PATCH function is successful or failure
we can leverage this with "two forms" or "PATCH used against controls" on canvas app
with two forms:
frmStudentGenInfo
frmStudentContactInfo
on SUBMIT button use the below expression
IfError(Patch(Students,Defaults(Students), frmStudentGenInfo.Updates,frmStudentContactInfo.Updates),Set(varSuccess,true);Set(varFailure,false),Set(varFailure,true);Set(varSuccess,false));If(varSuccess,Navigate('Success Screen'),If(varFailure,Navigate('Failure Screen')))with controls on canvas app:
IfError(Patch(
Students,
Defaults(Students),{studentName: txtStudentName, email: txtStudentEmail}),Set(varSuccess,true); Set(varFailure,false), Set(varFailure,true);Set(varSuccess,false));
If(varSuccess,Navigate('Success Screen'),If(varFailure,Navigate('Failure Screen')))So, basically we are setting up two variable values - to take respective actions based on the IfError function.
If the PATCH is successful - redirecting user to SUCESS SCREEN
If the PATCH is failed- redirecting user to Failure SCREEN (to show appropriate message)




Comments