It seems something has changed recently with the way newly created sites deal with Netlify forms.
I’m creating sites through the API, and I noticed ‘Form detection’ is disabled by default. I need to manually go to the UI to enable it, redeploy, and only then it detects my forms.
How can I change this? Is there a property in the Netlify API I can send to enable forms whenever I create/update a site?
Hi @nvdb31, welcome and thanks for the post.
Based on the API documentation links below you cannot enable form detection via the API. You have to manually go to the UI to enable it.
@hrishikesh, thanks for the correction.
However I honestly feel the Netlify Open API documentation needs an update as it’s very difficult to find information.
Most of the parameters are not explained and you can’t tell what it does.
Even the option "ignore_html_forms": false you provided is not available in the documentation. Correct me if I am wrong as I have searched the whole documentation.
I’d love to also confirm some extra details about this with regards to the netlify.toml file.
I know I could do this via the API and have written a script for that, but it would be more seamless if ignore_html_forms = false could be supplied via the netlify.toml file in the repo, or even for deploy previews from pull request.
I can see in the deploy preview and when merged, the production deploy, both of these detect the form and begin to collect submitted form data.
However, the Netlify UI says the following:
Form detection is disabled. To continue using Netlify Forms, re‑enable form detection and redeploy your site.
The form submissions are being collected, but the warning above is also shown.
It’s alsmost as though the example netlify.toml I gave above half works but some other setting is missing?
The UI will read the data from the database and the database will mark the form detection as disabled. It’s the same as enabling asset optimization from netlify.toml BUT leaving it disabled in the UI. The TOML doesn’t change our database, so the UI won’t necessarily reflect that.