r/hubspot • • 4h ago

Make It Monday: Show us what you're building with HubSpot and AI

2 Upvotes

Building something with HubSpot and AI? Share it here in the thread, finished or still a work in progress is fine.

Workflows, agents, prompts, apps, whatever you've got. Self promo is okay in this thread, so drop your link and tell us what it does.


r/hubspot • • 16h ago

Tips & Tricks Solved: last invoice date + amount on companies with a custom code action (and the gotchas I hit)

Post image
2 Upvotes

A while back I asked here how to show each company's last invoice date and amount from QuickBooks-synced invoices. Thanks to everyone who replied. Here's what I ended up building, in case it helps someone.
Why the native options didn't work:

  • Rollups can return the latest invoice date, but conditions don't support date fields (so no "dated today or earlier"), and there's no "amount of the latest record" rollup.
  • Invoice-based workflows don't offer Edit record or Copy property value, so they can't write to the associated company.
  • Copying from "most recently created" invoice ≠ latest invoice date (backfills and future-dated invoices break it).

What worked: a daily company-based workflow (enrolls only companies with at least one invoice) with a custom code step:

  1. Get the company's associated invoice IDs (v4 associations, paginated)
  2. Batch-read invoice date, status, amount billed, number and create date
  3. Filter: date ≤ today in the portal's time zone, not draft/voided, not on a small exclusion list
  4. Pick the latest date (ties → most recently created)
  5. Return found / date / amount / number → branch → Edit record

Running it daily means it recalculates from all invoices every time, so the first run backfills everything (no import needed), and future-dated invoices get picked up when their date arrives.
Gotchas:

  • Private apps are now "legacy." You create a service key instead (read-only scopes for invoices and companies) and store it as a secret.
  • The new code template returns { outputFields }; my older callback version threw "callback is not a function."
  • The workflow Test button didn't write anything for me. The custom code action's own Test action is what showed real outputs and errors.
  • Branch on an explicit "no" to clear fields, not "None met," or an error run will wipe good values.
  • Log the raw date. Invoice dates came through as T04:00:00Z (midnight US Eastern), which looked a day off until I printed it.

Also: the minimap panel in the workflow editor makes checking a branchy workflow way easier, if you haven't used it.
Happy to share the code structure if anyone's doing something similar.


r/hubspot • • 3h ago

Claude connector can't access Ads data?

1 Upvotes

Claude says it cant access any of the ads data - no ad spends, no ROI, no nothing. Doesn't look like the MCP server can do it either. Anyone have a good 3p tool for this? I use HS tagging and contact tracking so everything is already in HS, and I don't want to have to pull from 5 ad platforms if I don't have to.


r/hubspot • • 4h ago

Feedback What makes you stick to Hubspot & Salesforce?

Thumbnail reddit.com
0 Upvotes