Fetching data from Formik form using Gatsby and use Netlify functions to post into Sanity

Hi Jerome,

Better to back up a few steps and make sure all the basic pieces work before trying to debug :slight_smile:

First off, does your form work in Netlify? You get a 200 when POST’ing, the data from the POST is saved and shown in your netlify dashboard? If so, great start! If not, check out our forms debugging articles such as [Support Guide] Form problems, form debugging, 404 when submitting as well as "Page Not Found" when submitting form - #2 by perry and finally since you use gatsby, also see this blog post about gatsby+netlify that touches on form setup

If that does already work, awesome! That’s probably the biggest hurdle. Next up, how are you attempting to process the POST? Perhaps using an event triggered function? If so, this article may point the way: Debugging event-triggered functions - #2 by fool

Let us know more about what you’re doing and how you’re trying to do it and we’ll probably be able to give some more specific guidance, short of debugging your code (which is only half of the picture :))