Skip to content

From Raw Text to CRM Intelligence: AI-Powered Data Extraction in HubSpot

Not every product platform has a ready-made HubSpot integration. Sometimes the only information available is a block of text copied from a quote, configurator, order summary, form submission, or external system. That text may contain everything the business needs—model, dimensions, colors, delivery details, add-ons, and pricing—but it is not structured in a way HubSpot can use for automation, segmentation, reporting, or sales follow-up.

This workflow uses HubSpot’s Data Agent to extract configuration details from raw text, custom code to normalize the response, and record updates to save each value in the CRM. It then identifies high-value configurations based on the final price.

A practical example is a company selling configurable buildings, equipment, furniture, or other made-to-order products. Instead of asking a salesperson to manually re-enter every specification, the workflow turns the original configuration summary into structured HubSpot data automatically.

The Workflow

Hack an Intergration

1. Enroll records when product text becomes available

The contact-based workflow enrolls a record when the raw_product_text property is known. This property acts as the intake field for the unstructured configuration. The text could arrive from an integration, form submission, webhook, pasted sales note, imported spreadsheet, or another automation.

Because the trigger only requires source text, the workflow can support many systems without a dedicated native connector. Re-enrollment can be enabled when updated configurations should be processed again.

2. Extract a predictable JSON object with the Data Agent

The first workflow action sends the raw product text to a carefully constrained Data Agent prompt. The AI is not asked to write a summary or provide recommendations. It is asked to behave like a data-extraction engine and return one JSON object using an exact schema.

You are a data-extraction engine. Read the product configuration text below and extract the listed fields. Return ONLY a valid JSON object — no prose, no markdown, no backticks. Use exactly these keys. If a value is absent, use null for numbers and "" for text. For numbers, output digits only: no currency symbols, commas, or units. Fields: - building_model: product/model name - building_category: the category - width_ft: first dimension in feet (number) - length_ft: second dimension in feet (number) - base_price: base building price before add-ons (number) - siding_color, door_color, trim_color, roof_color: the color names - addons_summary: short plain-text list of added options and what each is - addons_price: total price of all add-ons (number) - configured_total: final configured total price (number) - delivery_method: exactly one of "Fully assembled", "On-site installation", or "Either" (use "Either" if both are offered) - delivery_notes: any delivery/installation conditions or requirements Product configuration text: """ """

Exact keys, digits-only numeric values, and controlled delivery options reduce ambiguity before the result reaches the custom code. Blank strings and null values also make missing information easier to handle consistently.

3. Parse and normalize the AI response

The custom-coded action reads the Data Agent response, removes accidental JSON code fences, parses the result, and converts numeric fields into numbers. It then exposes each extracted value as a separate workflow output.

How the Custom Logic Works

 const raw = event.inputFields["aiResponse"] || "{}";
let data = {};

try {
  data = JSON.parse(
    raw.replace(/```json|```/g, "").trim()
  );
} catch (error) {
  console.error("Could not parse AI response:", raw);
}

const num = (value) =>
  value === null || value === undefined || value === ""
    ? null
    : Number(value);

callback({
  outputFields: {
    building_model: data.building_model || "",
    building_category: data.building_category || "",
    width_ft: num(data.width_ft),
    length_ft: num(data.length_ft),
    base_price: num(data.base_price),
    siding_color: data.siding_color || "",
    door_color: data.door_color || "",
    trim_color: data.trim_color || "",
    roof_color: data.roof_color || "",
    addons_summary: data.addons_summary || "",
    addons_price: num(data.addons_price),
    configured_total: num(data.configured_total),
    delivery_method: data.delivery_method || "",
    delivery_notes: data.delivery_notes || ""
  }
});

This creates a clean boundary between AI output and CRM updates. The parser removes accidental code fences, while the numeric helper prevents blank values from being stored as zero and distorting reports.

4. Update the CRM record

The workflow then maps each custom code output to the corresponding HubSpot property. Separate edit-record actions save the model, category, siding color, door color, trim color, roof color, add-on summary, delivery method, delivery notes, width, length, base price, and add-on price.

The same structure can be adapted to the portal. The data could be written to a custom Product Configuration object, or the custom code could update several properties directly through the HubSpot API.

5. Identify high-value configurations

After the configuration is structured, the workflow branches on the configured total. Records above 4,000 enter the High Value Customer branch, which could notify an owner, create a deal, assign a senior representative, or begin personalized follow-up.

Use Cases

1. Replacing a missing integration

When a configurator cannot send every value separately, the business can send one text summary and let the workflow structure it in HubSpot. This creates a lightweight integration layer without waiting for a native connector.

2. Automating quote and order intake

Quotes, order confirmations, and proposal summaries can be converted into reportable CRM properties. Sales and operations teams gain access to dimensions, selected options, delivery requirements, and pricing without manually reviewing each document.

3. Prioritizing high-value opportunities

Once pricing and configuration details are stored as structured data, HubSpot can route premium opportunities, flag complex installations, segment customers by product category, and trigger different follow-up based on value or selected features.

Wrapping Up

This workflow bridges the gap between unstructured product information and a usable CRM data model. The Data Agent extracts the configuration, custom code normalizes it, and HubSpot turns the result into properties for automation, reporting, and sales prioritization.

No Bounds Digital helps businesses design AI-powered HubSpot workflows, build custom-coded actions, connect external data sources, and turn manual campaign decisions into reliable automation. Contact No Bounds Digital to discuss AI services or custom HubSpot development for your next workflow.

hands

Need Help?

Ask our HubSpot experts, and let us come up with a solution to your biggest challenges.