Cross-portal data model
Scanned 18 contractor HubSpot portals to learn how each stored its sales reps, then gated a year-in-review card on how complete each portal’s data was.
Data paths and guards
- 18 contractor portals: The HubSpot portals scanned for properties, object types and fill rates.
- Year-in-review card: A 14-slide React card inside one portal.
- Scanner scripts: 35 scripts: scans, fill rates, canonical mapping and config generation.
- Data model: Canonical mappings, fallback chains, a config for each portal and its rollout rating.
- Card function: A HubSpot serverless function that sums the portal’s deals inside that portal.
- From 18 contractor portals to Scanner scripts: Properties and fill rates. Every property, object type and fill rate in the 18 portals. Each scan run.
- From Scanner scripts to Data model: Mappings, configs, ratings. Canonical field mappings with fallback chains, a config for each portal and its rollout rating. Each scan run.
- From Data model to Card function: Property names only. The mapped property names for one portal, and no deal data. Deploying the card to a portal rated safe.
- From 18 contractor portals to Card function: That portal’s own deals. The deals of the portal where the card runs, read with the mapped properties. Building the card’s figures.
- From Card function to Year-in-review card: Figures for 14 slides. Awards and totals for the year, summed inside the portal. A user opens the card.
- On Property names only: Rollout gate on fill rate. A portal gets the card only when its fields are full enough for honest totals: 12 rated safe, 4 caution, 2 do not deploy.
- On That portal’s own deals: Deals stay in their portal. Only property names travel between portals; each portal’s deals are read and summed inside that portal.
- Built by me
- Platforms I connect to
- Guards
- In production
| Properties and fill rates Every property, object type and fill rate in the 18 portals |
|---|
| Mappings, configs, ratings Canonical field mappings with fallback chains, a config for each portal and its rollout rating |
| Property names only The mapped property names for one portal, and no deal data |
| That portal’s own deals The deals of the portal where the card runs, read with the mapped properties |
| Figures for 14 slides Awards and totals for the year, summed inside the portal |
-
Systems
Each contractor’s HubSpot portal stored its sales reps its own way. Node scripts run locally scanned all 18 and built one data model, and a HubSpot serverless function inside a portal reads that portal’s deals through it.
-
Data paths
The scripts cataloged 32,846 properties across 31 object types and mapped 7 sales-rep patterns onto one set of fields. A portal’s card function receives only the mapped names and builds 14 slides from that portal’s own deals.
- a Properties and fill rates
- b Mappings, configs, ratings
- c Property names only
- d That portal’s own deals
- e Figures for 14 slides
-
Guards
A portal gets the card only when its fields are full enough for honest totals, and no deal data ever leaves its own portal.
- Rollout gate on fill rate on c
- Deals stay in their portal on d
-
Result
The review rated 12 portals safe, 4 caution and 2 do not deploy. The card runs in 1 portal, on 263 deals.
Seven ways to record a sales rep across 18 portals
Portals kept their sales reps in different fields, many carried over from earlier CRMs: 7 patterns across 18 portals, so no single report could read them all the same way.
What I built
- 35 scripts that scanned 18 portals, measured how full every field was and generated each portal’s config.
- A canonical model with fallback chains, so one set of fields reads every way a portal stored its sales reps.
- A rollout review that rated each portal by fill rate before the card could go there.
- A 14-slide year-in-review card in HubSpot, computed from the portal’s own deals.
- A HubDB table of precomputed figures, so the card loads without waiting on live queries.
What the guards protect against
| The risk | The guard |
|---|---|
| Mostly empty fields turn into wrong sales totals on the slides. | Rollout gate on fill rate A portal gets the card only when its fields are full enough for honest totals: 12 rated safe, 4 caution, 2 do not deploy. |
| One contractor’s deal data reaches another contractor’s portal. | Deals stay in their portal Only property names travel between portals; each portal’s deals are read and summed inside that portal. |
Decisions
-
Rate every portal’s data before the card goes there
- Chose
- Each portal was rated by how full its fields were, and the card was planned only for the portals rated safe.
- Instead of
- Deploying the card to every portal at once. Where key fields were mostly empty, the card’s totals would have come out far below the real ones.
- Trade-off
- Portals rated caution or do not deploy were left out of the first wave.
Results
- 32,846 properties across 31 object types cataloged in 18 portals, 5,888 of them well filled.
- 7 different sales-rep field patterns found across the portals.
- Rollout rated 12 portals safe, 4 caution and 2 do not deploy.
- Live in 1 portal, on 263 deals.
Facts
- Two sales fields that looked like yes-or-no flags held user ids instead
- Slides include sales awards and the year’s fastest close
Related builds
-
Portal audit and scoping
Date: Aug 2026
Fact: Audited 279 workflows in a 4,102-deal portal
Client: For a construction company
Systems: JobTread
Status: Active
-
Quote-to-cash billing platform
Date: Sep 2026
Fact: 1,154 of 1,154 live agreements settled in the first billing run
Client: For a services company
Systems: NetSuite, Snowflake, dbt, Hex and AWS
Status: In production
-
Project-link backfills
Date: Jul 2026
Fact: 832 deals linked to their Zuper projects
Client: For four roofing contractors
Systems: Zuper
Status: Active