Creating a property that associates through matching numbers in HubSpot

I want to create a property for line items that would then connect to the order via matching the order number listed in the sequence of numbers. So if we have M3-1000202597-0010-00, the line item property would say based on this sequence of numbers, this is for order 1000202597 and it’s line 10. Is this possible?

@CHerdeg

Great question and this is definitely achievable in HubSpot, though it requires a bit of setup depending on how technical you want to go.

What you’re describing is essentially parsing a structured order reference number to extract two pieces of data: the order ID and the line number. Here are your options from simplest to most robust:

Option 1 — Manual custom properties (no code) Create two custom Line Item properties: Order Number and Line Number. Train your team (or your import process) to populate them manually by extracting the values from the full reference string. Not elegant, but works immediately with zero technical lift.

Option 2 — Workflow + Custom Coded Action If the full reference string is being captured as a property already (e.g. on the Line Item or Deal), you can use a Workflow with a Custom Coded Action (Operations Hub Professional required) to parse the string using JavaScript. Something like:

javascript

const ref = "M3-1000202597-0010-00";
const parts = ref.split("-");
const orderNumber = parts[1]; // "1000202597"
const lineNumber = parseInt(parts[2]); // 10

Then use hs.setProperty to write those extracted values back to your custom Order Number and Line Number properties. From there you can associate, report, and workflow off them like any other property.

Option 3 — HubSpot Operations Hub Data Quality Actions If you are on Ops Hub Pro, the Format Data action can do some string manipulation natively — though for a split like this, the custom code approach is cleaner and more reliable.

The association piece: HubSpot does not natively associate Line Items to custom objects purely by matching a property value — that linkage still needs to happen via the API or a coded workflow. If you are trying to auto-associate a Line Item to a Deal or custom Order object based on the extracted order number, you would need to use the Associations API or a tool like Make or Zapier to look up the matching record and create the association.

What does your current setup look like — are you on Ops Hub, and is this a CRM import scenario or something being generated in-system?


Note: I used AI to help structure and format this response. The troubleshooting approach is based on my own 11 years of HubSpot experience.

Hi @CHerdeg

I get what you’re trying to do, and it makes total sense from a data and reporting perspective. But HubSpot doesn’t really handle this natively.

There’s no built-in way for a line item property to “look at” a string like M3-1000202597-0010-00, break it apart, and then automatically say “this is order 1000202597 and line 10.” HubSpot just doesn’t do that kind of parsing on its own, especially at the line item level.
That said, it’s still doable; you just have to approach it a bit differently.

If that value is coming from another system (like an ERP), the best way is to split it before it even gets into HubSpot.
So instead of sending one combined string, you send:

  • The order number as one field
  • The line number as another

That way, everything is already clean and usable when it lands in HubSpot.

If that’s not an option, then you’re looking at using Operations Hub with a custom code workflow. That lets you take that string, split it using the dashes, and store the pieces in separate properties. It works well, but it does require some setup and the right HubSpot tier.

Without that, you’re kind of stuck storing the full value as-is, which doesn’t really help much for reporting or matching.

So yeah, what you want to do is completely logical, just not something HubSpot supports out of the box. You either fix it at the source or use a bit of custom logic inside HubSpot to make it work.
Hope this helped!