Understanding data fields
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.
TL;DR
Access: Campaign settings → Custom fields → + New field → 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.
4 things to understand
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.
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.
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.
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.
Common searches
data field • df_ field • JSON field • structured data • array field • data field JSON • quotation lines
Related articles
How do I create custom fields?
Working with data fields in booking forms (advanced JSON storage)
Using signature sketch fields for digital signatures
Creating a quotation line generator with visual presentation
hh-components reference guide
Campaign webpages and webpage forms — Displaying data to leads
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article