Skip to content

Build a custom block with Custom HTML

How-to10 minExpert

Before you start

Custom HTML is the component to reach for when the standard fields don’t fit the block you need: a status banner, a checklist, a small approval box. You write the HTML. Beezr fills in live values from the record and saves what people type. It is an expert tool, so test it with a few records before people use it.

  1. In the Form builder, drag Custom HTML from the Components tab into a block.
  2. Click the cog icon on the card. The card first says “No template yet. Open settings to write the HTML.”
  3. Write the template in the HTML Template editor.
  4. Click Check Configuration, read the result, then click Done and Save the form.

After you write a template, the card says “Template ready. Open settings to edit it.”

The panel offers three building blocks.

You writeWhat happens
$fieldName$Replaced with the current value of that field when the form loads. A read-only display
$[expression]Beezr evaluates the expression and puts the result into the HTML
data-field="fieldName" on an inputWhat the person types is saved into that field when the form is saved

A small example from the panel:

<p>Current status: $status$</p>
<label>Update status:</label>
<input type="text" data-field="status" />

Turn on Write captured inputs to another module under Cross-Module Write. The panel then asks for Target Module Configuration.

SettingWhat it is for
Target ModuleThe module that receives the captured input. Beezr creates or updates a record there
Relation FieldThe field in the target module that stores this record’s key, the link back to this record
Parent key fieldWhich field of this record supplies the key. Leave Use Primary Key (default) in most cases
Prefill mappingsWhen no child record exists yet, copy these parent fields into the new child’s fields. + Add Mapping adds a pair

How it behaves:

  • $fieldName$ always reads from the parent, the record on the form.
  • data-field inputs show the child record’s values when one exists. The first time, prefill mappings fill them.
  • When you add a new record, the child is saved right after the parent. When you edit an existing record, the child is saved with it.

For example, a Contracts form can hold a small “Legal review” box. The reviewer’s notes are captured into a Legal Reviews module, linked back to the contract by the relation field.

  • Check Configuration reports “No issues found — configuration looks good.” or a count of errors, warnings and notes. Run it before you save.
  • Use input elements to capture data. The data-field name must match a real field. Check the spelling.
  • Same-module capture writes into the record on the form, and the field must exist in this module.
  • Tokens are display only. The panel says $fieldName$ is replaced “at form load (read-only display)”. To let people change a value, add an input with data-field.

Check yourself

A Custom HTML template contains <input type="text" data-field="status" />. What does data-field do?
Show the answer

It saves what the user types into the record's status field when the form is saved. data-field names the field that receives the typed value on submit. In cross-module mode it saves to the target module instead.

Cross-Module Write is on. Where does $fieldName$ read its value from?
Show the answer

The parent record, the one on the form. Beezr's reference says tokens always read from the parent record, even in cross-module mode. Only the data-field inputs show the child record's values.

What's next

Last checked