Recipe 05: Form submission to CRM
Goal: a "Contact us" form creates or updates a contact in HubSpot and tells your sales team in Slack.
Difficulty: Beginner · Time: about 15 minutes · Connectors: Form Trigger, HubSpot, Slack
Prerequisites
- A HubSpot credential with write access to contacts.
- A Slack credential and a sales channel, for example
#sales-inbound.
Finished workflow
Step-by-step
1. Form Trigger
Add a Form Trigger titled Contact us, with these fields:
| Label | Type | Required |
|---|---|---|
| First name | Text | Yes |
| Last name | Text | Yes |
| Yes | ||
| Company | Text | No |
| Message | Text Area | No |
Set a Success Message, such as "Thanks. We will be in touch within one working day."
The answers are in $trigger.payload, keyed by each field's internal ID, such as field_1760000000000. This recipe writes firstName, lastName, email, company and message in place of those IDs for readability. Submit the form once, then insert the real paths with the data picker. See Form trigger.
2. HubSpot: create or update the contact
Add a HubSpot node named Save contact:
- Credential: your HubSpot credential
- Resource: Contact
- Operation: Create or Update
- email:
{{ $trigger.payload.email }}(required) - firstname:
{{ $trigger.payload.firstName }} - lastname:
{{ $trigger.payload.lastName }} - company:
{{ $trigger.payload.company }}
The new contact's ID is {{ $node["Save contact"].output.data.id }}.
3. Slack notification
Add a Slack node:
- Resource: Message
- Operation: Send
- Channel:
#sales-inbound - Text:
:wave: New inbound lead: *{{ $trigger.payload.firstName }} {{ $trigger.payload.lastName }}* ({{ $trigger.payload.email }}) from *{{ $trigger.payload.company }}* > {{ $trigger.payload.message }} HubSpot contact ID: {{ $node["Save contact"].output.data.id }}
4. Save and activate
Save, then set the workflow to Active in the editor toolbar's version menu.
Try it
- Copy the form URL from the Form Trigger's inspector and open it in a browser.
- Submit a test entry with your own email.
- Check HubSpot: the contact is there.
- Check the Slack channel: the message is posted.
Variations
Score the lead with AI
Add an AI Agent node between the Form Trigger and HubSpot that rates the message from 1 to 5. Include {{ $node["AI Agent"].output.content }} in the Slack message.
Route by company size
Add a Switch node after HubSpot that sends enterprise leads to one channel and the rest to another.
Log a note on the contact
Add a second HubSpot node with Resource Engagement, using the notes engagement type, to store the form message on the contact.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| The form starts no run | The workflow is not active | Activate the workflow |
| HubSpot rejects the request | email is empty or invalid |
Make the Email field required. Check the expression points to the right field ID. |
| HubSpot answers that the contact already exists | A contact with this email exists | Use Search first, then Update with the found ID when there is a match |
| No Slack message | The HubSpot node failed, so the run stopped | Open the run in Logs and fix the HubSpot error first |
| Values are empty in Slack | The expressions use the wrong field IDs | Re-insert them with the data picker after a test submission |
Next
Found something out of date? This page lives in the Flero docs content set.