<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Prevent Forms API Submission from creating new Non-HubSpot Form? in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Prevent-Forms-API-Submission-from-creating-new-Non-HubSpot-Form/m-p/781805#M63155</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/553429"&gt;@duncanleung&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;prevent the creation of a "Non-HubSpot form" when using the Hubspot Forms API.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;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.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Here's an example of how you can modify your API request:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="ruby"&gt;POST https://api.hsforms.com/submissions/v3/integration/submit/:portalId/:formGuid?hutk=&amp;lt;hutk&amp;gt;&amp;amp;hsFormsCallbackFunction=&amp;lt;callback function&amp;gt;&amp;amp;formId=&amp;lt;existing form GUID&amp;gt;
&lt;/LI-CODE&gt;
&lt;P&gt;Replace &lt;CODE&gt;&amp;lt;existing form GUID&amp;gt;&lt;/CODE&gt; with the GUID of your existing Hubspot form, and make sure to include the other required parameters.&lt;/P&gt;
&lt;P&gt;By passing the &lt;CODE&gt;formId&lt;/CODE&gt; parameter, Hubspot will recognize the existing form and use it for the submission, without creating a new one in the dashboard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Apr 2023 06:16:27 GMT</pubDate>
    <dc:creator>himanshurauthan</dc:creator>
    <dc:date>2023-04-14T06:16:27Z</dc:date>
    <item>
      <title>Prevent Forms API Submission from creating new Non-HubSpot Form?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Prevent-Forms-API-Submission-from-creating-new-Non-HubSpot-Form/m-p/781797#M63154</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The issue I'm facing:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When I submit data to an existing Hubspot &lt;STRONG&gt;"Regular"&lt;/STRONG&gt; form:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;a new &lt;STRONG&gt;"Non-HubSpot form" is created&lt;/STRONG&gt; in the Forms dashboard (&lt;EM&gt;&lt;STRONG&gt;Marketing &amp;gt; Lead Capture &amp;gt; Forms&lt;/STRONG&gt;&lt;/EM&gt;)&lt;/LI&gt;&lt;LI&gt;Data is submitted to --both-- the "Regular" form and the "Non-HubSpot form"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To me, this is unexpected behavior.&lt;/P&gt;&lt;P&gt;I don't want my marketing team to be confused by data being submitted to two forms.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the Form API:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;POST &lt;A href="https://api.hsforms.com/submissions/v3/integration/submit/:portalId/:formGuid" target="_blank"&gt;https://api.hsforms.com/submissions/v3/integration/submit/:portalId/:formGuid&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://legacydocs.hubspot.com/docs/methods/forms/submit_form" target="_blank"&gt;https://legacydocs.hubspot.com/docs/methods/forms/submit_form&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm building a form in React&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;NextJS&lt;/LI&gt;&lt;LI&gt;react-hook-form&lt;/LI&gt;&lt;LI&gt;TailwindCSS&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to prevent the&amp;nbsp;"Non-HubSpot form" from being created?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;Duncan&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 05:35:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Prevent-Forms-API-Submission-from-creating-new-Non-HubSpot-Form/m-p/781797#M63154</guid>
      <dc:creator>duncanleung</dc:creator>
      <dc:date>2023-04-14T05:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent Forms API Submission from creating new Non-HubSpot Form?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Prevent-Forms-API-Submission-from-creating-new-Non-HubSpot-Form/m-p/781805#M63155</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/553429"&gt;@duncanleung&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;prevent the creation of a "Non-HubSpot form" when using the Hubspot Forms API.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;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.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Here's an example of how you can modify your API request:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="ruby"&gt;POST https://api.hsforms.com/submissions/v3/integration/submit/:portalId/:formGuid?hutk=&amp;lt;hutk&amp;gt;&amp;amp;hsFormsCallbackFunction=&amp;lt;callback function&amp;gt;&amp;amp;formId=&amp;lt;existing form GUID&amp;gt;
&lt;/LI-CODE&gt;
&lt;P&gt;Replace &lt;CODE&gt;&amp;lt;existing form GUID&amp;gt;&lt;/CODE&gt; with the GUID of your existing Hubspot form, and make sure to include the other required parameters.&lt;/P&gt;
&lt;P&gt;By passing the &lt;CODE&gt;formId&lt;/CODE&gt; parameter, Hubspot will recognize the existing form and use it for the submission, without creating a new one in the dashboard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 06:16:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Prevent-Forms-API-Submission-from-creating-new-Non-HubSpot-Form/m-p/781805#M63155</guid>
      <dc:creator>himanshurauthan</dc:creator>
      <dc:date>2023-04-14T06:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent Forms API Submission from creating new Non-HubSpot Form?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Prevent-Forms-API-Submission-from-creating-new-Non-HubSpot-Form/m-p/781916#M63160</link>
      <description>&lt;P&gt;Hi Himanshu,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunatley, passing the query params into the API call did not resolve the issue.&lt;/P&gt;&lt;P&gt;Submitting the form still creates a new&amp;nbsp;"Non-HubSpot form".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moreover, I believe I'm already passing these values in the API call:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;formGuid&lt;/STRONG&gt;&lt;/FONT&gt;: I'm passing this in the URL path &lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#0000FF"&gt;/submit/:portalId/:formGuid&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;hutk&lt;/STRONG&gt;&lt;/FONT&gt;: I'm passing this in the JSON body of the POST&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Duncan&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 09:40:13 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Prevent-Forms-API-Submission-from-creating-new-Non-HubSpot-Form/m-p/781916#M63160</guid>
      <dc:creator>duncanleung</dc:creator>
      <dc:date>2023-04-14T09:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent Forms API Submission from creating new Non-HubSpot Form?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Prevent-Forms-API-Submission-from-creating-new-Non-HubSpot-Form/m-p/782171#M63172</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/553429"&gt;@duncanleung&lt;/a&gt;&amp;nbsp;with the react js handling the form POST, it's working as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;Justin&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 18:17:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Prevent-Forms-API-Submission-from-creating-new-Non-HubSpot-Form/m-p/782171#M63172</guid>
      <dc:creator>MrJustinGivens</dc:creator>
      <dc:date>2023-04-14T18:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent Forms API Submission from creating new Non-HubSpot Form?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Prevent-Forms-API-Submission-from-creating-new-Non-HubSpot-Form/m-p/782197#M63175</link>
      <description>&lt;P&gt;Thanks for the help&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/16592"&gt;@MrJustinGivens&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That worked!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, we do have the HubSpot site tracking (js-script) added as well, to include the cookie value with the form submission.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to disable react-hook-form from trying to submit the form on 'Enter' keypress.&lt;/P&gt;&lt;P&gt;I also removed the &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;onSubmit&lt;/FONT&gt;&lt;/STRONG&gt; event handler on the &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;form /&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt; element.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN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t;SPAN&gt;checkKeyDown&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;  ...&lt;BR /&gt;&amp;lt;/form&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And used the &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;onClick&lt;/STRONG&gt;&lt;/FONT&gt; event on the button to submit the form:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;import { useForm } from 'react-hook-form';&lt;BR /&gt;&lt;BR /&gt;const { handleSubmit } = useForm();&lt;BR /&gt;&lt;BR /&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;Button&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;type&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"submit"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;onClick&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;() &lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  void &lt;/SPAN&gt;&lt;SPAN&gt;handleSubmit&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;onSubmit&lt;/SPAN&gt;&lt;SPAN&gt;)();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  Submit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;Button&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Apr 2023 18:45:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Prevent-Forms-API-Submission-from-creating-new-Non-HubSpot-Form/m-p/782197#M63175</guid>
      <dc:creator>duncanleung</dc:creator>
      <dc:date>2023-04-14T18:45:22Z</dc:date>
    </item>
  </channel>
</rss>

