Retrieving submission_id after form submit

Hello,

I have web app based on https://nextjs-platform-starter.netlify.app/ template with the Netlify form. I need to somehow get the submission_id back after the submit.
Now I am getting 200 response with the basic response template. I have read something about custom form submission responses but it seems to be about the redirect page. Is there a way to achieve this?

Only other way I have in mind is to create function that will on call get X form submissions, look through them and find the one by some piece of data passed, and then return the submission ID. It might work but it feels sketchy, if there is a lot of concurrent submissions there would have to be pagination and I might run into a timeout. Or there might be two submission with same piece of data, I know that if I would generate some long random string it is very unlikely but it can happen.

I need this because I need to verify that the submission is really stored, reverify the data that are in the submission and most importantly I need and unique identifier of the submission and the submission_id seems to be the perfect fit for that. I will generate some key out of that and share it with the customer so they can refer to that submission later.

@kumbalek As you’ve discovered the only customization available for a standard form submission is the success page that is displayed.

Since you’re trying to do something other than just “submit the form” you’re correct that you probably want to create a custom function and submit to it instead.

Your concerns seem implementation specific so I can’t advise if they’re warranted.

It should be fairly trivial to:

  • submit to your own function
  • have the function perform whatever it needs to
  • have the function respond however it needs to