We’re trying to capture form submission data (specifically the phone number, email address, and form ID) whenever a HubSpot form is submitted.
Our goal is to:
Trigger a webhook on form submission.
Receive the phone number, email address, and form ID in the webhook payload.
I’m a bit unclear on how to achieve this? Has anyone implemented this before and can share the right way to pull these specific fields from the webhook payload?
Set up a workflow in HubSpot that triggers when a form is submitted.
In the workflow, use the “Trigger a webhook” action. Enter your webhook URL (this is where you want to receive the form submission data).
HubSpot will send a payload to your webhook. The payload includes all form fields, submission data, and the form GUID.
In your webhook handler, parse the payload. Look for the fields you need: email, phone number, and form ID. Typically, these will be present in the values array or object. You can match them by their internal names, like email or phone.
Test your setup by submitting the form. Check your webhook endpoint to confirm you’re receiving the fields you want.
Hi @GiantFocal,
We don’t have the subscription to use the “Trigger a webhook” action in workflows.
Is there a way to achieve the result through some other way or via APIs?
Hi @CDan2 and thanks for getting back to us!
Thanks for the help @GiantFocal!
I’d love to put you in touch with our Top Experts: Hi @sylvain_tirreau, @Anton and @SteveHTM can you think of a workaround or other suggestions to help @CDan2, please?
Have a lovely day and thanks so much in advance for your help!
Bérangère
Classic HubSpot blackmail attempt. You just need this ‘enter anything that normally is included in any other CRM platform’ which you get by upgrading to the next level.
Given your constraints, here’s what I would do if I were you:
1) Create a text property named (for example) “trigger_my_webhook”;
2) Create a private application and a webhook that points to “www.your-server.com/your-script” and monitors changes to the “trigger_my_webhook” property;
3) In your form, insert the “trigger_my_webhook” property but hide it, and pre-populate it with a value of your choice (see a more robust option below);
4) When your form is validated, the property will change, and the target of the webhook (“www.your-server.com/your-script”) will process the request in this way: if the value of “trigger_my_webhook” is empty, you do nothing, but if it contains the value that you have defined in the property of your form, you will retrieve the information you need (phone, address, etc.) from the contact concerned via the API, and above all you reset the value of the “trigger_my_webhook” field to zero, for other submissions from this contact.
One alternative would be to have your field populated with a unique value generated by JavaScript when the form loads on your web page. This way, in “www.your-server.com/your-script”, you only process the same value once and avoid resetting it to zero (the front-end form does this automatically with each submission).
Thanks @GiantFocal - that could work for me. It is rather complex compared to simply have Forms emit an evant I can let my webhook listen to and process.
Would be great if this was added soon dear HubSpot!
Totally get the constraint. Without access to the workflow “Send a webhook” action, you have two reliable paths that don’t require upgrading.
If you’re okay spinning up a small developer app, use HubSpot’s Webhooks (App) subscriptions. Create an app in a developer account, add a subscription for form submission events, install the app on your portal, and HubSpot will POST each submission to your endpoint. The payload includes the form GUID and submitted fields; you can pull email and phone by their internal names (commonly “email”, “phone”, or “mobilephone”) (https://developers.hubspot.com/docs/api-reference/webhooks-webhooks-v3/guide )
This route is set-and-forget once the app is installed.
If building an app isn’t ideal, poll the Forms API for submissions. Use the “Get submissions for a form” endpoint, which returns each submission with the formGuid and a values array containing the submitted properties.
Small note: phone can live in either phone or mobilephone depending on your form fields.
One clarifying question to make sure you won’t miss data: are these HubSpot-hosted forms or embedded on your site?
If they’re embedded, you can also capture the fields in your page code and fan out to your webhook while still submitting to HubSpot, which avoids polling.
Hope this helps. When this hinges on reliable two-way sync, Stacksync handles the mapping and timing so records stay consistent without manual patches.
Hey @RubenBurdin, could you please let me know the exact steps for “add a subscription for form submission events”? We have an App; however, we don’t see “form submission events”, so we’re stuck in this step.
The simplest (because there would be two or three other solutions) in my humble opinion is that you create a property in contact that could have as name “form_submission”, which is typed as a string, with an improbable default value (this property will receive a contact id, so you put any value that will never be a contact id: “0”, “--”, “NONE”, “NULL”, etc.). You then create a workflow that triggers on all form fillings, and in action choose to fill the “form_submission” property with the contactId who filled the form (you can also use the email instead of the contactId). Finally, in your application, you create a webhook event (“webhook” section of your application) on the change of the “form_submission” property and this points to a url which retrieves the value of the “form_submission” field and which will search via the contact API or the search api the contact information that you want to retrieve, and this only if the value of “form_submission” is not the default value (“0”, “--”, “NONE”, “NULL”, etc.). And when you have retrieved the information, you reset the value of the property to its default value (“0”, “--”, “NONE”, “NULL”, etc.).
If you are really too restricted in the workflows, you can create a simple webhook on the change of the email and phone property, and then you check with the Hubspot APIs the information you want to retrieve, but this webhook will launch each time the phone and email properties change, and you will have to for example read the value of hs_latest_source to know if it is indeed a form that changed the property…