It's nice to see the form data to be stored in netlify.
Now, what's next. I am going to store my form data to FaunaDB.
- Create a Db-schema folder with registration.gql
- Login to FaunaDB Console
- Create new DB with FaunaDB
- Import schema (DB Console -> GraphQL -> Import Schema)
- Create a new FUANA_DB_SECRET with security tab in console
- In netlify console.
- Go to Deploy Settings -> Environment -> Edit variable Add FAUNA_DB_SECRET -> Copy paste your secret here. This is used for authentication purpose.
Create netlify functions manually
- create a functions folder at root level
- within functions folder create your netlify functions i.e for the form submission create submission-created.js under the functions folder. The functions name also needs to match the specific event name with netlify events. The available event triggers available here on netlify docs
$ netlify functions:create submission-created
$ netlify deploy --prod
Now, in netlify console in functions tab all available netlify functions will be listed. Click on function for debug purposes.
Functions to run in netlify we need a netlify.toml (configuration) file
Now the data which is pushed on netlify forms will also be available in FuanaDB for use.