Skip to main content
Category: Controls · Writes to: the product database · Reads data: no

Mental model

A Database Form is a data-entry slip. Fill it in, submit, and the row lands directly in a database table — no firmware round-trip. Think of it as the write end of your product’s database.

When to use it

  • Log an entry from the dashboard (a service note, a manual reading)
  • Capture structured data that belongs in a table, not on a device

Settings

General

  • Widget Title / ID
  • Auto-generate fields from table schema — build the form from an existing table’s columns automatically
  • Per field: label, type, placeholder, options, required
  • Submit button label
  • Reset after submit — clear the form on success

Style

Background, border, font, padding, container visibility.

Where the data goes

On submit, the Database Form inserts a record into the bound table. It’s the UI equivalent of the Database API insert or the Script API’s db.insert:
// equivalent programmatic write
await db.insert('service_logs', { note: '...', device: context.deviceId });
Display the stored rows with a Table or Dynamic Repeater widget bound to the same table.

Script API example

The same interactions from a dashboard script:
widget.on('logForm', 'submit', async () => {
  const rows = await db.query('service_logs', {}, { limit: 1 });
  widget.setText('lastEntry', rows[0]?.note ?? '\u2014');
});

Database (Studio)

Create the schema and table first.

db.insert

The scripted equivalent.