Dynamically redirect confirmation page thanks to a Webservice response

Hello there,

I’ve made a Gravity Form which is submitted in ajax mode.
I actually have to send my submitted form data to a Webservice. I made it via gform_after_submission action.

  • Now I’m looking to choose the confirmation page dynamically, thanks to webservice response (if webservice call is in success, display a page. Otherwise show an other).
  • An alternative would be to show an error message in form ?

Could someone help me to do it ? Is there some action / filter to use to do this ?

Thanks :slight_smile:

You won’t be able to use gform_after_submission if you want to show an error in the form OR modify the confirmation. You could instead use gform_pre_validation or gform_pre_submission in order to have the answer you need before the entry is written and before the confirmation is shown.