Barcode Scanner
Overview
A text field with a Scan button that reads barcodes through the camera on supported browsers. Where scanning is unavailable, the code can be typed.
Scans barcodes with the camera where the browser supports it.
When to use
- Scan a product to add it to a stock count
- Look up an item by its barcode
- Check in parcels or assets by label
When not to use
- QR codes specifically: use QR Scanner, which is tuned for them
- High-volume warehouse scanning with dedicated hardware: a hardware scanner typing into a Text Input is faster
Quick start
- Add a Barcode Scanner (inside a Form, or alone to drive a lookup)
- Set Label and Field key
- On Change, add actions such as Set State or Navigate to the product page using Event → value
- Test on a phone in Chrome or Edge, allowing camera access
Properties
The caption shown above the field. Keep it short and specific ("Work email", not "Email 2"). It is also read by screen readers and used in automatic error messages.
Default: Barcode Scanner
Example: Delivery address
The key this value is saved under when the form is submitted. To save into an entity field, use that field's key exactly (lowercase, underscores). Inputs without a key are not included in the saved record.
Default: barcode_scanner
Example: phone_number
Two inputs with the same key overwrite each other. Keys must start with a letter and contain only lowercase letters, digits and underscores.
Grey example text shown inside the empty field. It disappears as soon as the visitor types, so never use it instead of a label.
Example: e.g. +1 555 0100
A short hint shown under the field until a validation error replaces it. Use it for format expectations or why you ask for the information.
Example: We only call about your order.
The value the field starts with. It is included when the form is submitted even if the visitor never touches the field. Bind it to pre-fill the code from the current user, a page parameter or the current record.
Blocks submission while the field is empty and shows a red asterisk next to the label. The message is “<Label> is required” unless you set a Validation message.
Default: false
Shows the value but prevents editing. Useful for values you pre-fill and want the visitor to see but not change. Bind it to make a field editable only for some roles or statuses.
Default: false
Greys the field out and skips it from keyboard navigation. Bind it to a condition such as “Status is Closed” to lock a field in context.
Default: false
Data binding
The decoded text (digits or characters printed under the barcode) is saved as text. Outside a form, the value is available as component state for lookups.
Properties that can use dynamic data: Label, Placeholder, Help text, Default value, Read only, Disabled.
Events
- On change
- Runs every time the code changes. The new value is available as Event → value. Typical uses: Set State to drive a filter or a visibility rule, Show Toast for instant feedback. Avoid slow actions (API calls) on every keystroke.
- On focus
- Runs when the visitor enters the field (click or Tab). Useful for showing contextual help or opening a drawer with instructions.
- On blur
- Runs when the visitor leaves the field. A good moment to run lookups (e.g. fetch customer details once an email is complete) because it fires once instead of on every keystroke.
Actions
Open the Actions tab in the inspector, pick an event and add actions such as Go to page, Create record or Show message. Actions run in order; data-changing actions run on the server with the signed-in user's permissions.
Other components can read this component's value from the Data Picker → Component state.
Responsive behavior
Uses 6 of 12 columns by default. In the Responsive tab you can change visibility, span, dimensions, padding, margin, font, order, alignment, direction separately for tablet and mobile.
Permissions
Needs camera permission. Scanning relies on the browser's built-in barcode detector (Chrome and Edge on Android and desktop); other browsers show the manual entry only.
Mobile behavior
- Uses the rear camera; hold the code steady and well lit
- Scanning stops automatically after the first successful read
Examples
Stock lookup
Barcode Scanner: Label “Scan item” (outside any form) On Change: Navigate → Product details, sku = Event → value Product details page: Detail View filtered by sku = Page parameter sku
Limitations
- Browser support varies; Safari and Firefox fall back to typing
- The Placeholder control is ignored; the field explains scanning availability itself
Troubleshooting
Why: The browser does not support barcode detection
Fix: Use Chrome or Edge, or type the code