How to use custom form action

In the form settings there is an option to add custom Redirect URL and Action. What should the API callback under Action URL return? Is there any format for errors along with error messages, success, so that this information is conveyed back to the user through standard Webflow form features after submitting.

No, when you use a custom action to handle your form data submission, you’re entirely outside of the Webflow framework and using HTTP/HTML standard behavior.

In HTML forms, when the browser submits data to a server, the server returns the HTML response, or else a redirect to send the browser elsewhere.

An approach I generally use is to front that with a script, so that when the form is submitted, my script steps in, packages up the data, sends it to an automation webhook, and then receives and process the response. It keeps everything on one page.

I built SA5’s form handlers to offer some nocode support for this technique. This way you can return an HTTP 200 response code ( and SA5 will display the Webflow form’s success message ), or an error code to display the error message. Basic stuff but quite useful.

1 Like

When setting up a custom Redirect URL and Action in the form settings, the API callback under the Action URL should typically return a JSON response. For success, you would usually return something like {“status”: “success”, “message”: “Your form has been submitted successfully.”}. For errors, a common format is {“status”: “error”, “message”: “There was an issue submitting your form. Please try again.”}. This way, Webflow can parse the response and display the appropriate message to the user.