Hubhus
ToolsAgent loginSubmit a ticket
All articles

Data & Custom Fields / Data fields

Understanding data fields

Published 28. sep. 2026, 16.03

TL;DR

Access: Campaign settings → Data fields → + New data field . Data fields store JSON in a lead record. Slug always starts with df_ . Write via: jQuery('#df_slug').val(JSON.stringify(data)) . Read via hh-data-fields.value component on webpages. Define a JSON Schema to validate structure. Use for: quotation lines, selected products, multi-step form data, calculation results.

Data fields are JSON-based custom fields that store structured data - arrays, objects, or nested values - per lead. Unlike regular text fields, data fields can hold multiple items, making them ideal for price calculations, product selections, multi-step form results, and anything that requires structured data storage.

4 things to understand

  1. What data fields store. A data field stores a single JSON value per lead - typically an array of objects (e.g. a list of selected products) or a single object (e.g. calculation results). The slug always starts with df_ (e.g. df_quotation_lines, df_selected_products). The field is empty until something writes a JSON value to it via JavaScript or an HTTP request JSON map.
  2. Writing to a data field. In a Hubhus form or webpage, write to the field using jQuery: jQuery('#df_slug').val(JSON.stringify(yourData)). The hidden input with id="df_slug" is injected by Hubhus - use this ID to set the value before form submission. Data is only saved when the form is submitted (or auto-saved). Always stringify the data before setting the value.
  3. Reading data fields on webpages. On campaign webpages (display to lead), use the hh-data-fields.value component to render data field values: <hh-data-fields.value field="df_slug" />. For structured data (arrays), use hh-data-fields.array with a template for each item. In email/SMS templates, use {{df_slug}} or iterate via template loops.
  4. JSON Schema validation. Define a JSON Schema on the field to validate the structure of stored data. Hubhus validates against the schema on save - invalid data is rejected. This prevents bad data from entering the system. Schema also enables autocomplete in the Hubhus playground. Important: never make a breaking schema change (e.g. removing or renaming keys) on a field with existing lead data - old values must remain valid, or perform a conscious migration.
Read more

Common use cases

  • Quotation line generator: Store an array of selected products/services per lead, render as a price table on a webpage
  • Multi-step form results: Accumulate answers across multiple form steps into one structured field
  • Calculation outputs: Store intermediate and final calculation results for display on confirmation pages
  • External API responses: Write structured data from HTTP request JSON maps back into a data field

Example: writing an array

var lines = [
  { name: 'Produkt A', qty: 2, price: 499 },
  { name: 'Produkt B', qty: 1, price: 199 }
];
jQuery('#df_quotation_lines').val(JSON.stringify(lines));
data field
json
storage
Didn't find the answer? Submit a ticket and we'll get back to you as soon as possible.