Prevent Forms API Submission from creating new Non-HubSpot Form?
SOLVE
Hey @duncanleung with the react js handling the form POST, it's working as expected.
But you probably have the HubSpot Site tracking (js-scripts) codes added to the site so it doesn't know that form and is create a new form that is type of "non-hubspot-form".
The way to get around this is to not trigger the onSubmit in the HTML form (or the button), and handle it all in javascript onClick of the specific button you want.
Prevent Forms API Submission from creating new Non-HubSpot Form?
SOLVE
Hey @duncanleung with the react js handling the form POST, it's working as expected.
But you probably have the HubSpot Site tracking (js-scripts) codes added to the site so it doesn't know that form and is create a new form that is type of "non-hubspot-form".
The way to get around this is to not trigger the onSubmit in the HTML form (or the button), and handle it all in javascript onClick of the specific button you want.
prevent the creation of a "Non-HubSpot form" when using the Hubspot Forms API.
This behavior occurs because Hubspot generates a unique identifier for each form submission, and if the identifier doesn't match an existing form in the dashboard, a new form is created.
To avoid this, you can pass the existing form GUID as a parameter in your API request. This way, Hubspot will recognize the form and use it for the submission instead of creating a new one.
Here's an example of how you can modify your API request:
POST https://api.hsforms.com/submissions/v3/integration/submit/:portalId/:formGuid?hutk=<hutk>&hsFormsCallbackFunction=<callback function>&formId=<existing form GUID>
Replace <existing form GUID> with the GUID of your existing Hubspot form, and make sure to include the other required parameters.
By passing the formId parameter, Hubspot will recognize the existing form and use it for the submission, without creating a new one in the dashboard.