> ## Documentation Index
> Fetch the complete documentation index at: https://docs.os.default.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding a scheduler to HubSpot forms in Default

> Show a Default booking calendar after a visitor submits an embedded HubSpot form: the HubSpot embeds the Pixel supports, how it detects them, field mapping for HubSpot property names, the HubSpot setting to change, and troubleshooting.

Default can show a booking calendar the moment a visitor submits an embedded HubSpot form on
your website. The Default Pixel captures the HubSpot submission, a Default workflow picks the
host, and the calendar opens on the same page. HubSpot keeps processing the submission as it
normally does.

For the full path from submission to booked meeting, see
[How Default books a meeting from a form submission](/forms/scheduler).

## HubSpot forms in Default at a glance

| Question | Answer |
| - | - |
| Which HubSpot embeds work? | HubSpot's original embed code and its newer embed, including the developer embed. |
| How does Default get the submission? | The Pixel on your page listens for HubSpot's own submission events. There is no per-form code to add. |
| When does Default capture it? | After HubSpot accepts the submission. |
| Does HubSpot still receive the submission? | Yes. Default does not block or replace HubSpot's form. |
| Do I need the HubSpot integration connected? | Not to capture the form. Connect [HubSpot](/settings/integrations/hubspot) if the workflow reads or writes HubSpot records. |
| How does Default identify the form? | By its HubSpot form GUID (globally unique identifier), the same on every page and every page load. |

## How the Pixel detects a HubSpot form

The Pixel recognizes a `<form>` element on the page as a HubSpot form when any of these is true:

* Its `id` starts with `hsForm_`.
* It has the `hs-form` class.
* Its `action` URL points at `hsforms.com` or `hubspot.com`, or a subdomain of either. A form
  with no `action`, or one whose `action` only mentions HubSpot in its path or query string, does
  not count.
* It contains a hidden field named `hs_context`.

Catalog mode uses these rules to find HubSpot forms on the page. The Pixel's plain-HTML capture
skips forms that match them, so each HubSpot submission reaches Default once.

The submission itself comes from HubSpot's events:

| HubSpot embed | What the Pixel listens for | Form ID Default receives |
| - | - | - |
| Original embed code | HubSpot's form callback message when the submission succeeds (`onFormSubmitted`) | The form GUID |
| Newer embed and developer embed | HubSpot's `hs-form-event:on-submission:success` event. The Pixel then reads the answers through HubSpot's form API. | The form GUID |

The newer embeds give the form element a new `id` on every page load, such as
`hs_form_target_widget_<timestamp>-<guid>` or `<container-id>-<guid>`. Default reads the GUID
at the end of the `id`, so every render of the same HubSpot form maps to 1 form in Default.
A HubSpot form embedded on several pages of the same domain is also 1 form in Default.

## Before you start

| Requirement | Where |
| - | - |
| The Pixel installed in the `<head>` of every page with the HubSpot form | See [Set up the Pixel and Forms SDK](/pixel-sdk-setup). |
| The page's domain connected in **Signals** | See [Signals](/forms/signals). Connecting `example.com` also covers its subdomains. |
| An email field on the HubSpot form | A submission without an email address does not start a workflow. |
| A scheduling event with hosts | See [Events](/events). |
| Admin access in Default | Adding forms and mapping fields need admin access. |

## Add a scheduler to a HubSpot form

<Steps>
  <Step title="Install the Pixel on the form's pages">
    Add the Pixel snippet to the `<head>` of every page where the HubSpot form appears,
    including HubSpot-hosted pages on your own domain. Load it on every page load, not from a
    submit handler.
  </Step>

  <Step title="Set the HubSpot form to show a thank-you message">
    In HubSpot, set what happens after a visitor submits the form to show a thank-you message,
    and turn off any redirect to another page. Default does not stop a HubSpot redirect, and a
    redirect can take the visitor off the page before the calendar opens.

    To send visitors somewhere after they book, use **Add redirect on meeting booked** on the
    **Display Scheduler** node instead.
  </Step>

  <Step title="Add the form with Catalog forms">
    In **Signals**, open the domain's menu and select **Catalog forms**. Start on the page with
    the HubSpot form and select **Open catalog mode**. Select **Add form** on the HubSpot form,
    name it, and confirm. The form is active right away. See
    [Your forms](/forms/your-forms#add-forms-from-your-site).
  </Step>

  <Step title="Map the HubSpot fields">
    In **Forms**, open the form and select **Map fields**. Map at least the email field to the
    person's email, then the fields your routing uses, such as company or country. A mapping
    belongs to the field name, so it also applies to your other forms with a field of that
    name. See [Field mapping for HubSpot forms](#field-mapping-for-hubspot-forms).
  </Step>

  <Step title="Build the workflow">
    In **Workflows**, add a **Form Submission** trigger and set **Connected Form** to the
    HubSpot form. Add a **Display Scheduler** node and choose the **Event**. Add follow-up steps
    on the **Booked** and **Not booked** branches. See
    [Routing and scheduling nodes](/workflows/steps-routing-scheduling#display-scheduler).
  </Step>

  <Step title="Publish and test">
    Select **Publish**, then turn on the [deployment switch](/workflows#the-enabled-switch) so the
    status reads **Live**.
    Submit the HubSpot form on your live page with a test email. The loading indicator appears,
    then the calendar.
  </Step>
</Steps>

## Field mapping for HubSpot forms

Default receives each HubSpot field under its HubSpot property name, such as `email`. Map
those names to Default person and company fields. Default handles these HubSpot details for
you:

| HubSpot detail | What Default does |
| - | - |
| The newer embeds prefix property names with an object type, such as `0-1/email` for a contact property and `0-2/email` for a company property. | Default keeps the prefixed name and also adds the plain name, such as `email`. It adds the plain name only when 1 object uses it, so a contact `0-1/email` and a company `0-2/email` stay separate. |
| Checkbox groups arrive as 1 value joined with semicolons, such as `Customer;Partner`. | Default splits the value into a list. A value whose options contain spaces stays as 1 text value. |
| Fields whose names contain sensitive words, such as `password`, `token`, `key`, or `auth`. | Default never captures them. See [Privacy & data handling](/forms/privacy#fields-never-captured). |
| Fields you leave unmapped. | Default still keeps them on the submission, and the workflow can read them. |

Mapping applies to new submissions only. A mapping belongs to the field name, not to 1 form:
**Map fields** lists only this form's fields, but a change there applies on every form in your
workspace with a field of that name.

## How HubSpot forms behave with the scheduler

* **The loading indicator shows after every HubSpot submission.** The Pixel cannot tell in
  advance whether a HubSpot form is wired to a scheduler, so it shows the indicator until Default
  answers. For a form with no scheduler workflow, the indicator closes on its own.
* **HubSpot's after-submit action still runs.** A thank-you message appears in the form while
  the calendar opens over the page. A redirect to another page can take the visitor away
  before the calendar opens.
* **Early identification works for forms in your page.** When the HubSpot form renders in your
  page, the Pixel sends the email to Default as soon as the visitor leaves the email field, so
  the calendar is ready sooner after submit.
* **Forms inside a cross-origin iframe are out of reach.** Catalog mode and early
  identification cannot read into an iframe served from another domain. Check how your HubSpot
  embed renders the form if catalog mode shows no badge on it.

## Route HubSpot form leads to the right rep

The **Display Scheduler** node decides who the visitor books with:

* **A team:** create a Team event with a [queue](/queues) as a host. The queue's policy picks
  the rep when the visitor books.
* **The existing owner:** add a **Match Record** node with **CRM** set to **HubSpot** before
  the scheduler. Turn off **Use event hosts** and pass the matched record's owner as the host,
  with a **Fallback Host** for when the owner is away. Each owner needs their HubSpot Owner ID
  mapped in [Users](/settings/users).
* **A rule:** a [Rules of Engagement](/rules-of-engagement) node picks the owner, and
  **Latest resolved user** becomes the host.

See [Routing picks the host](/forms/scheduler#step-3-routing-picks-the-host) for every option.

## Troubleshoot HubSpot forms

| What you see | What to check |
| - | - |
| The page redirects before the calendar opens | Change the HubSpot form to show a thank-you message instead of redirecting. |
| Catalog mode shows no badge on the HubSpot form | The form may render inside a cross-origin iframe, which the Pixel cannot read. Also check for a `data-default-ignore` attribute on the form or a wrapper. |
| Submissions do not appear on the form in **Forms** | Confirm the form was added with **Catalog forms**, is active, and that the domain shows **Active** in **Signals**. |
| The workflow does not start | Confirm the HubSpot form has an email field, the workflow is published and live, and **Connected Form** is this form. |
| A field is missing from the submission | Its name may match a sensitive pattern. See [Privacy & data handling](/forms/privacy#fields-never-captured). |
| The calendar takes a long time to appear | Load the Pixel in the page `<head>` on every page load. Keep slow steps after the **Display Scheduler** node. |

### Check what the Pixel sees

1. Before the Pixel loads, set `window.__defaultPixel__logging__verbose = true` on the page.
2. Open the browser console and show verbose messages.
3. Submit the HubSpot form with a test email.

| Console message | What it means |
| - | - |
| `[Default.com] [Listener] Found HubSpot form submission: <form GUID>` | The Pixel captured a submission from HubSpot's original embed code. |
| `[Default.com] [Listener] Found HubSpot V4 form submission: <form GUID>` | The Pixel captured a submission from HubSpot's newer embed. |
| Neither message after a successful HubSpot submission | The Pixel did not load before the form, or the page path is excluded from capture. See [Privacy & data handling](/forms/privacy#turning-capture-off). |

Related: [Sales scheduling software from Default](https://www.default.com/product/sales-scheduling-software)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.