An isolated demo of a netlify submission-created function. Hosted on Netlify at https://romantic-kirch-49286a.netlify.app/
Is it possible to modify the response of a submission-created
Function?
- A form (in
inedx.html
) with a single text field, handled with Netlify Forms - A Netlify function for the
submission-created
event infunctions/submission-created.js
When submitting the form, the expecation is that I will see the return value specified in submission-created.js
return {
statusCode: 200,
body: JSON.stringify({ message: "A new form submission came in" }),
};
When submitting the form, I see the standard Netlify Forms submission success screen
The function is being invoked. I can confirm that with the function log:
The form submissions are coming in as expected. Can see those in the Verified submissions.
When running locally with netlify dev
this works as expected. Submitting the form responds with the custom response set in submission-created
. It makes sense because we don't have the standard Netlify form success page locally, but does create confusion because it's different than how things work in production.