Using custom code in HubSpot workflows

Using custom code in HubSpot workflows to elevate the viewing experience

Mark Flint

HubSpot workflows are already one of the most powerful tools available to teams who care about automation, consistency and scale. But once you add custom code into the mix (via Data Hub Pro), workflows move from being helpful to genuinely transformative.

Custom code actions allow you to manipulate data in ways that simply aren’t possible with standard workflow actions alone. That means cleaner data, smarter automation and, crucially, better experiences for your customers.

In this article, I want to walk through a real case study of how we’ve used custom code in HubSpot workflows to solve a surprisingly common problem around meeting communications, and how doing so improved brand perception and reduced no-shows for our clients.

The problem: meetings are functional, but not always on-brand

Many of our real estate clients rely on HubSpot’s meeting scheduler to allow prospects and customers to book property viewings. Out of the box, this works really well. HubSpot can send confirmation and reminder emails automatically in the run-up to the meeting.

The challenge is that these emails are one-to-one emails sent from the meeting host. For some organisations, that’s fine. For many of our clients, they wanted fully branded emails too.

The data limitation that caused the headache

HubSpot stores the meeting date and time in a property called Date of last meeting booked in meetings tool. In the CRM, this property clearly shows both the date and time.

However, when you insert that property into an email using a personalisation token, HubSpot only outputs the date, not the time.

That creates a poor experience. A confirmation email that says “Your viewing is booked for 27/01/2026” but doesn’t include the time isn’t really a confirmation at all.

We needed the date and the time, and we needed them in a format that felt natural and human.

Step one: creating the right properties

To solve this, we first created three new contact properties:

  • Viewing date and time – a date/time property
  • Viewing date – a single-line text property
  • Viewing time – a single-line text property

The workflow itself was triggered when a specific meeting scheduler was submitted.

The first action was a simple copy:

  • Copy Date of last meeting booked in meetings tool
  • Into Viewing date and time

Interestingly, even though these are both date time properties, the new property does output both date and time when used as a personalisation token. That alone unlocked part of the problem.

But the format still wasn’t customer-friendly.

27/01/2025 14:30 GMT+1

Technically accurate, but not exactly warm or on-brand.

Step two: using custom code to make the data human

This is where custom code in workflows really earns its keep.

We added a custom code action that:

  1. Took the value from Viewing date and time
  2. Split it into separate date and time components
  3. Reformatted each into a customer-friendly format

So:

  • 27/01/2026 became 27th January
  • 14:30 GMT+1 became 2:30pm

Those formatted values were then saved into:

  • Viewing date
  • Viewing time

Now we had clean, readable data that could be dropped straight into a marketing email without apology or explanation.

 

Custom code example

 

Step three: powering pre- and post-viewing communications

With those properties in place, the rest of the workflow became straightforward.

Pre-viewing email

Immediately after the meeting was booked, the workflow sent a branded marketing email that:

  • Thanked the contact for booking their viewing
  • Confirmed the date and time using the new properties
  • Included arrival instructions
  • Linked out to Google Maps
  • Set clear expectations for what would happen next

Post-viewing follow-up

We then added a delay until three hours after the viewing start time, which in practice was around two hours after the viewing ended.

At that point, a second marketing email was sent:

  • Thanking the contact for attending
  • Reinforcing next steps
  • Keeping the brand experience consistent beyond the appointment itself

All of this ran automatically, without relying on individual team members to remember follow-ups or manually send emails.

The outcome: better experience, fewer no-shows

The impact was immediate.

Clients who adopted this model saw:

  • A more polished, professional brand experience
  • Clearer communication around viewings
  • Increased confidence from customers
  • A noticeable reduction in no-shows

Most importantly, the automation worked with HubSpot’s existing tools, not against them. Meetings still did what meetings are good at. Marketing emails did what marketing emails are good at. Custom code simply bridged the gap between the two.

Final thoughts

Custom code in HubSpot workflows isn’t about making things complicated. It’s about removing friction where the standard tools fall just short.

If you’re already using Data Hub Pro and you’re not exploring custom code actions, you’re almost certainly leaving experience improvements on the table. Start with one real problem, one workflow and one small win. The results tend to speak for themselves.

If you want help designing or implementing something similar, that’s exactly the kind of challenge we enjoy solving.

About Incremental

We help businesses grow with HubSpot. We’re in the top 8% of HubSpot agencies worldwide and have a flawless 5-star rating from every one of our HubSpot clients.

5.0 out of 5.0

5.0 out of 5.0

Platinum HubSpot Partner
Platinum HubSpot Partner

Copyright © 2025 Incremental.